File Coverage

blib/lib/Try/Tiny/Tiny.pm
Criterion Covered Total %
statement 18 18 100.0
branch 6 6 100.0
condition 2 3 66.6
subroutine 3 3 100.0
pod n/a
total 29 30 96.6


line stmt bran cond sub pod time code
1 2     2   818 package Try::Tiny::Tiny; use strict; use warnings;
  2     2   4  
  2         44  
  2         7  
  2         3  
  2         329  
2              
3             $Try::Tiny::Tiny::VERSION = '0.003';
4              
5             my $effective;
6              
7             BEGIN {
8 2 100   2   10 if ( not exists $INC{'Try/Tiny.pm'} ) {
9 1         3 my @hide = qw( Sub/Name.pm Sub/Util.pm );
10 1         3 local @INC{ @hide };
11 1         3 delete @INC{ @hide };
12 1 100 66     6 local @INC = ( sub { die if 'Try::Tiny' eq caller and grep $_ eq $_[1], @hide }, @INC );
  3         902  
13 1         7 require Try::Tiny;
14             }
15 2         725 my $cb = sub { (caller 0)[3] };
  4         56  
16 2         5 my $name = &$cb;
17 2         6 $effective = $name eq &Try::Tiny::try($cb);
18 2 100       52 warn __PACKAGE__ . " is ineffective (probably loaded too late)\n" unless $effective;
19             }
20              
21             $effective;
22              
23             __END__