File Coverage

blib/lib/PerlIO/via/Pipe.pm
Criterion Covered Total %
statement 22 22 100.0
branch 3 4 75.0
condition n/a
subroutine 7 7 100.0
pod 3 3 100.0
total 35 36 97.2


line stmt bran cond sub pod time code
1 1     1   928 use 5.008;
  1         11  
  1         51  
2 1     1   6 use strict;
  1         1  
  1         33  
3 1     1   6 use warnings;
  1         2  
  1         67  
4              
5             package PerlIO::via::Pipe;
6             our $VERSION = '1.100860';
7             # ABSTRACT: PerlIO layer to filter input through a Text::Pipe
8 1     1   6 use Exporter qw(import);
  1         3  
  1         285  
9             our %EXPORT_TAGS = (util => [qw(set_io_pipe)],);
10             our @EXPORT_OK = @{ $EXPORT_TAGS{all} = [ map { @$_ } values %EXPORT_TAGS ] };
11              
12             sub set_io_pipe ($) {
13 1     1 1 25136 our $pipe = shift;
14             }
15              
16             sub PUSHED {
17 1     1 1 2028 my ($class, $mode) = @_;
18 1 50       7 return -1 if $mode ne 'r';
19 1         5 my $buf = '';
20 1         51 bless \$buf, $class;
21             }
22              
23             sub FILL {
24 28     28 1 2542 my ($self, $fh) = @_;
25 28         87 my $line = <$fh>;
26 28 100       85 return unless defined $line;
27 27         28 our $pipe;
28 27         67 $pipe->filter($line);
29             }
30             1;
31              
32              
33             __END__