File Coverage

blib/lib/Acme/Onion.pm
Criterion Covered Total %
statement 16 16 100.0
branch 2 4 50.0
condition 4 6 66.6
subroutine 3 3 100.0
pod n/a
total 25 29 86.2


line stmt bran cond sub pod time code
1             package Acme::Onion;
2 1     1   150387 use strict;
  1         3  
  1         60  
3 1     1   6 use warnings;
  1         2  
  1         291  
4              
5             our $VERSION = "0.04";
6              
7             BEGIN {
8             push @INC, sub {
9 3         178871 my ($coderef, $file) = @_;
10              
11 3         21 (my $onion = $file) =~ s/\.pm$/.🧅/;
12              
13 3         8 for my $dir (@INC) {
14 17         30 my $filepath = $dir . '/' . $onion;
15              
16 17 50 66     281 next if ! -e $filepath || -d _ || -b _;
      66        
17              
18 1 50       49 if (open my $fh, '<', $filepath) {
19 1         4 $INC{$file} = $filepath;
20 1         405 return $fh;
21             }
22             }
23 2         59 return;
24             }
25 1     1   56 };
26              
27             1;
28             __END__