File Coverage

blib/lib/encoding/stdio.pm
Criterion Covered Total %
statement 8 18 44.4
branch 1 2 50.0
condition n/a
subroutine 2 5 40.0
pod n/a
total 11 25 44.0


line stmt bran cond sub pod time code
1             package encoding::stdio;
2 2     2   1103 use strict;
  2         3  
  2         588  
3             require encoding;
4             our $VERSION = '0.02';
5             our @ISA = ('encoding');
6              
7             sub DEBUG () { 0 }
8              
9             sub import {
10 2     2   21 my $class = shift;
11 2         7 my ($name, %arg) = @_;
12 2         9 local ${^ENCODING};
13 2 50       8 if ($arg{Filter}) {
14 0         0 local $INC{"Filter/Util/Call.pm"} = "dummy";
15             local *Filter::Util::Call::import = sub {
16 0     0   0 DEBUG && warn "F'U'C->i faked";
17 0         0 };
18             local *encoding::filter_add = sub {
19 0     0   0 DEBUG && warn "filter_add faked";
20 0         0 };
21 0         0 $class->SUPER::import(@_);
22             } else {
23 2         16 $class->SUPER::import(@_);
24             }
25             }
26              
27             sub unimport {
28 0     0     my $class = shift;
29 0           local $INC{"Filter/Util/Call.pm"} = 0; # pretend it's not there
30 0           local ${^ENCODING};
31 0           $class->SUPER::unimport(@_);
32             }
33              
34             1;
35             __END__