line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::PrintUsed; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
11415
|
use 5.006; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
75
|
|
4
|
2
|
|
|
2
|
|
9
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
53
|
|
5
|
2
|
|
|
2
|
|
15
|
use warnings; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
311
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our @ISA = qw(); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.05'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub ModulesList { |
12
|
3
|
|
|
3
|
1
|
13
|
my @modules; |
13
|
|
|
|
|
|
|
|
14
|
3
|
|
|
|
|
204
|
foreach (sort keys %INC) { |
15
|
204
|
|
|
|
|
332
|
my $name = $_; |
16
|
204
|
|
|
|
|
664
|
$name =~ s|[\\/]|::|g; |
17
|
204
|
|
|
|
|
641
|
$name =~ s|\.pm$||; |
18
|
|
|
|
|
|
|
|
19
|
204
|
|
|
|
|
228
|
my $version; |
20
|
|
|
|
|
|
|
{ |
21
|
|
|
|
|
|
|
# Prevent warnings caused by autosplitted modules. |
22
|
|
|
|
|
|
|
# See RT#48573. |
23
|
2
|
|
|
2
|
|
11
|
no warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
603
|
|
|
204
|
|
|
|
|
200
|
|
24
|
204
|
|
100
|
|
|
9201
|
$version = eval " \$$name\::VERSION " || ''; |
25
|
|
|
|
|
|
|
} |
26
|
204
|
|
|
|
|
1229
|
push @modules, { name => $name, version => $version, |
27
|
|
|
|
|
|
|
path => $INC{$_} }; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
3
|
|
|
|
|
56
|
return @modules; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub FormattedModulesList { |
34
|
2
|
|
|
2
|
1
|
9
|
my $text = "\nModules used by $0:\n"; |
35
|
2
|
|
|
|
|
31
|
my @modules = ModulesList(); |
36
|
|
|
|
|
|
|
|
37
|
2
|
|
|
|
|
9
|
foreach (@modules) { |
38
|
136
|
|
|
|
|
541
|
$text .= " - $_->{name} " . (" " x (25 - length($_->{name}))) . |
39
|
|
|
|
|
|
|
"$_->{version} " . (" " x (8 - length($_->{version}))) . |
40
|
|
|
|
|
|
|
"$_->{path}\n"; |
41
|
|
|
|
|
|
|
} |
42
|
2
|
|
|
|
|
6
|
$text .= "\n"; |
43
|
|
|
|
|
|
|
|
44
|
2
|
|
|
|
|
175
|
return $text; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
END { |
48
|
2
|
|
|
2
|
|
734
|
print STDERR FormattedModulesList(); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |
53
|
|
|
|
|
|
|
__END__ |