bin/pmload

filter: Statementstmt 89.4% 17 / 19 Branchbran 50.0% 3 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 82.1% 23 / 28 CC 1 SCAR 0.0
CC
1
Cov
80%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« bin/podgrep ↑ Summary bin/sitepods »
1 #!/usr/bin/env perl
2 # pmload -- show what files a module loads
3  
4 # ------ pragmas
5 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 our $VERSION = '2.0.0';
9  
10 # ------ define variables
11 1 my $module = undef; # module name
12 1 my %seen = (); # list of files we've seen before
13  
14 1 ▶BEGIN { $^W = 1 }
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 1 ▶die "usage: $0 module\n" unless @ARGV == 1;
Branch: 1 branch
BranchTrueFalseTotal
unless @ARGV == 1 0 1 1
17  
18 1 %seen = %INC;
19  
20 1 $module = shift;
21 1 eval "local \$^W = 0; require $module";
22  
23 1 ▶if ($@) {
Branch: 1 branch
BranchTrueFalseTotal
if ($@) 0 1 1
24 0 $@ =~ s/at \(eval.*$//;
25 0 die "$0: $@";
26 }
27  
28 1 for my $path (values %INC) {
29 96 ▶ print "$path\n" unless $seen{$path};
Branch: 1 branch
BranchTrueFalseTotal
unless $seen{$path} 96 0 96
30 }
31  
32 __END__
« bin/podgrep ↑ Summary bin/sitepods »