line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
101115
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
41
|
|
2
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
46
|
|
3
|
|
|
|
|
|
|
package App::Whatsit; |
4
|
|
|
|
|
|
|
BEGIN { |
5
|
1
|
|
|
1
|
|
19
|
$App::Whatsit::VERSION = '0.0.1'; |
6
|
|
|
|
|
|
|
} |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# ABSTRACT: Easily find out package details from the command line. |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
5
|
use base qw(App::Cmd::Simple); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6393
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub validate_args |
14
|
|
|
|
|
|
|
{ |
15
|
1
|
|
|
1
|
1
|
53841
|
my $self = shift; |
16
|
1
|
|
|
|
|
4
|
my $options = shift; |
17
|
1
|
|
|
|
|
2
|
my $args = shift; |
18
|
|
|
|
|
|
|
|
19
|
1
|
50
|
|
|
|
8
|
$self->usage_error("At least one package name is required") unless @$args; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub execute |
23
|
|
|
|
|
|
|
{ |
24
|
1
|
|
|
1
|
1
|
6
|
my $self = shift; |
25
|
1
|
|
|
|
|
2
|
my $options = shift; |
26
|
1
|
|
|
|
|
3
|
my $args = shift; |
27
|
|
|
|
|
|
|
|
28
|
1
|
|
|
|
|
2
|
foreach (@$args) |
29
|
|
|
|
|
|
|
{ |
30
|
1
|
|
|
|
|
4
|
_find_details($_); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub _find_details |
35
|
|
|
|
|
|
|
{ |
36
|
1
|
|
|
1
|
|
3
|
my $package = shift; |
37
|
|
|
|
|
|
|
|
38
|
1
|
|
|
1
|
|
9
|
eval "use $package"; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
18
|
|
|
1
|
|
|
|
|
109
|
|
39
|
1
|
50
|
|
|
|
334
|
if($@) |
40
|
|
|
|
|
|
|
{ |
41
|
|
|
|
|
|
|
# TODO bail out (completely) |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
else |
44
|
|
|
|
|
|
|
{ |
45
|
1
|
|
|
|
|
13
|
my $version = $package->VERSION; |
46
|
1
|
50
|
|
|
|
6
|
$version = 'Unknown' unless defined $version; |
47
|
|
|
|
|
|
|
|
48
|
1
|
|
|
|
|
3
|
my $package_file = $package.'.pm'; |
49
|
1
|
|
|
|
|
5
|
$package_file =~ s/::/\//g; |
50
|
1
|
|
|
|
|
3
|
my $path = $INC{$package_file}; |
51
|
1
|
50
|
|
|
|
6
|
$path = 'Unknown' unless defined $path; |
52
|
|
|
|
|
|
|
|
53
|
1
|
|
|
|
|
13
|
print "$package:\n\tVersion: $version\n\tPath: $path\n"; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
__END__ |