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 203     203   218097 use strict;
  203         277  
  203         6643  
4              
5 203     203   755 use vars qw($VERSION);
  203         223  
  203         36026  
6             $VERSION = '1.370'; # 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 202     202 1 2383 my $package = (caller())[0];
20              
21 202         559 foreach my $resource (@resources) {
22 201     201   19649 eval "package $package; use $resource";
  0     201   0  
  0     201   0  
  201     201   80434  
  201     201   643  
  201     201   3721  
  201     201   18490  
  1     201   22  
  1     201   9  
  201     201   80115  
  200     201   569  
  200     201   4504  
  201     200   18376  
  1     200   22  
  1         8  
  201         76586  
  201         647  
  201         3831  
  201         17919  
  0         0  
  0         0  
  201         87916  
  201         650  
  201         3879  
  201         19356  
  1         21  
  1         23  
  201         75200  
  200         617  
  200         3692  
  201         18557  
  0         0  
  0         0  
  201         85496  
  200         586  
  200         3855  
  200         19376  
  0         0  
  0         0  
  200         94174  
  200         639  
  200         4036  
  2812         148014  
23 2812 100       10572 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 1406 100 100     14323 redo if $@ =~ /Can't locate.*?in \@INC/ and $resource =~ s/::XS::/::/;
27 2         10 die;
28             }
29             }
30             }
31              
32             1;
33              
34             __END__