line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::PrintUsed; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
11766
|
use 5.006; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
82
|
|
4
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
76
|
|
5
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
300
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our @ISA = qw(); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.06'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub ModulesList { |
12
|
3
|
|
|
3
|
1
|
12
|
my @modules; |
13
|
|
|
|
|
|
|
|
14
|
3
|
|
|
|
|
182
|
foreach (sort keys %INC) { |
15
|
204
|
|
|
|
|
229
|
my $name = $_; |
16
|
204
|
|
|
|
|
608
|
$name =~ s|[\\/]|::|g; |
17
|
204
|
|
|
|
|
479
|
$name =~ s|\.pm$||; |
18
|
|
|
|
|
|
|
|
19
|
204
|
|
|
|
|
157
|
my $version; |
20
|
|
|
|
|
|
|
{ |
21
|
|
|
|
|
|
|
# Prevent warnings caused by autosplitted modules. |
22
|
|
|
|
|
|
|
# See RT#48573. |
23
|
2
|
|
|
2
|
|
11
|
no warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
647
|
|
|
204
|
|
|
|
|
140
|
|
24
|
204
|
|
100
|
|
|
7946
|
$version = eval " \$$name\::VERSION " || ''; |
25
|
|
|
|
|
|
|
} |
26
|
204
|
|
|
|
|
909
|
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
|
10
|
my $text = "\nModules used by $0:\n"; |
35
|
2
|
|
|
|
|
9
|
my @modules = ModulesList(); |
36
|
|
|
|
|
|
|
|
37
|
2
|
|
|
|
|
7
|
foreach (@modules) { |
38
|
136
|
|
|
|
|
121
|
my $lengthName = 25 - length($_->{name}); |
39
|
136
|
100
|
|
|
|
177
|
$lengthName = 0 unless $lengthName > 0; |
40
|
136
|
|
|
|
|
138
|
my $lengthVersion = 8 - length($_->{version}); |
41
|
136
|
100
|
|
|
|
196
|
$lengthVersion = 0 unless $lengthVersion > 0; |
42
|
|
|
|
|
|
|
|
43
|
136
|
|
|
|
|
331
|
$text .= " - $_->{name} " . (" " x $lengthName) . |
44
|
|
|
|
|
|
|
"$_->{version} " . (" " x $lengthVersion) . |
45
|
|
|
|
|
|
|
"$_->{path}\n"; |
46
|
|
|
|
|
|
|
} |
47
|
2
|
|
|
|
|
5
|
$text .= "\n"; |
48
|
|
|
|
|
|
|
|
49
|
2
|
|
|
|
|
250
|
return $text; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
END { |
53
|
2
|
|
|
2
|
|
903
|
print STDERR FormattedModulesList(); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |
58
|
|
|
|
|
|
|
__END__ |