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   844 use strict; use warnings;
  2     2   4  
  2         44  
  2         8  
  2         3  
  2         353  
2              
3             package Try::Tiny::Tiny;
4             our $VERSION = '0.005';
5              
6             my $effective;
7              
8             BEGIN {
9 2 100   2   9 if ( not exists $INC{'Try/Tiny.pm'} ) {
10 1         2 my @hide = qw( Sub/Name.pm Sub/Util.pm );
11 1         3 local @INC{ @hide };
12 1         3 delete @INC{ @hide };
13 1 100 66     5 local @INC = ( sub { die if 'Try::Tiny' eq caller and grep $_ eq $_[1], @hide }, @INC );
  3         1207  
14 1         13 require Try::Tiny;
15             }
16 2         620 my $cb = sub { (caller 0)[3] };
  4         54  
17 2         5 my $name = &$cb;
18 2         6 $effective = $name eq &Try::Tiny::try($cb);
19 2 100       50 warn __PACKAGE__ . " is ineffective (probably loaded too late)\n" unless $effective;
20             }
21              
22             $effective;
23              
24             __END__