File Coverage

blib/lib/POE/Resources.pm
Criterion Covered Total %
statement 46 54 85.1
branch 4 4 100.0
condition 3 3 100.0
subroutine 17 17 100.0
pod 1 1 100.0
total 71 79 89.8


line stmt bran cond sub pod time code
1             package POE::Resources;
2              
3 178     178   1480 use strict;
  178         290  
  178         8612  
4              
5 178     178   1010 use vars qw($VERSION);
  178         257  
  178         32597  
6             $VERSION = '1.367'; # NOTE - Should be #.### (three decimal places)
7              
8             my @resources = qw(
9             POE::XS::Resource::Aliases
10             POE::XS::Resource::Events
11             POE::XS::Resource::Extrefs
12             POE::XS::Resource::FileHandles
13             POE::XS::Resource::SIDs
14             POE::XS::Resource::Sessions
15             POE::XS::Resource::Signals
16             );
17              
18             sub load {
19 177     177 1 1943 my $package = (caller())[0];
20              
21 177         596 foreach my $resource (@resources) {
22 176     176   44071 eval "package $package; use $resource";
  0     176   0  
  0     176   0  
  176     176   80907  
  176     176   504  
  176     176   3422  
  176     176   34858  
  1     176   31  
  1     176   12  
  176     176   75206  
  175     176   522  
  175     176   4103  
  176     175   38070  
  1     175   28  
  1         11  
  176         95614  
  176         487  
  176         4007  
  176         50354  
  0         0  
  0         0  
  176         103359  
  176         1066  
  176         4481  
  176         40815  
  1         26  
  1         10  
  176         99716  
  175         2040  
  175         3904  
  176         35051  
  0         0  
  0         0  
  176         85779  
  175         544  
  175         4513  
  175         38945  
  0         0  
  0         0  
  175         111047  
  175         619  
  175         19454  
  2462         193109  
23 2462 100       10988 if ($@) {
24             # Retry the resource, removing XS:: if it couldn't be loaded.
25             # If there's no XS:: to be removed, fall through and die.
26 1231 100 100     18989 redo if $@ =~ /Can't locate.*?in \@INC/ and $resource =~ s/::XS::/::/;
27 2         9 die;
28             }
29             }
30             }
31              
32             1;
33              
34             __END__