File Coverage

blib/lib/PerlIO/via/escape_ansi.pm
Criterion Covered Total %
statement 28 28 100.0
branch 4 4 100.0
condition n/a
subroutine 8 8 100.0
pod 0 2 0.0
total 40 42 95.2


line stmt bran cond sub pod time code
1             package PerlIO::via::escape_ansi;
2              
3             require 5.008;
4 3     3   51662 use strict;
  3         8  
  3         123  
5 3     3   16 use warnings;
  3         6  
  3         90  
6 3     3   98 use XSLoader;
  3         8  
  3         102  
7              
8              
9             {
10 3     3   16 no strict "vars";
  3         4  
  3         317  
11             $VERSION = "0.01";
12             XSLoader::load(__PACKAGE__, $VERSION);
13             }
14              
15              
16             sub import {
17 3     3   25 my ($class, @args) = @_;
18              
19 3 100       47 if (grep { $_ eq "-as_function" } @args) {
  1         6  
20 3     3   16 no strict "vars";
  3         6  
  3         752  
21 1         7 require Exporter;
22 1         17 @ISA = qw< Exporter >;
23 1         3 @EXPORT = qw< escape_non_printable_chars >;
24 1         117 $class->export_to_level(1);
25             }
26             }
27              
28              
29             #
30             # PerlIO methods
31             # --------------
32              
33             sub PUSHED {
34 3     3 0 4094 my ($class, $mode) = @_;
35 3         28 return bless {}, $class;
36             }
37              
38             sub FILL {
39 6     6 0 54 my ($self, $fh) = @_;
40 6         22 my $line = <$fh>;
41 6 100       33 return undef unless defined $line;
42 3         25 return escape_non_printable_chars ($line);
43             }
44              
45              
46             "true value on strike"
47              
48             __END__