line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lib::ModuleSymbol; |
2
|
|
|
|
|
|
|
# $Id: ModuleSymbol.pm,v 1.7 2004/03/28 00:27:53 kiesling Exp $ |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
# Copyright © 2001-2004 Robert Kiesling, rkies@cpan.org. |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# Licensed under the same terms as Perl. Refer to the file, |
7
|
|
|
|
|
|
|
# "Artistic," for information. |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
$VERSION=0.54; |
10
|
1
|
|
|
1
|
|
10
|
use vars qw( @ISA @EXPORT @EXPORT_OK $VERSION ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
525
|
|
11
|
|
|
|
|
|
|
push @ISA, qw( Exporter DB ); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
0
|
|
|
0
|
0
|
|
my $proto = shift; |
15
|
0
|
|
0
|
|
|
|
my $class = ref( $proto ) || $proto; |
16
|
0
|
|
|
|
|
|
my $self = { |
17
|
|
|
|
|
|
|
pathname => undef, |
18
|
|
|
|
|
|
|
packagename => undef, |
19
|
|
|
|
|
|
|
version => undef, |
20
|
|
|
|
|
|
|
}; |
21
|
0
|
|
|
|
|
|
bless( $self, $class); |
22
|
0
|
|
|
|
|
|
return $self; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
my @scannedpackages; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub scannedpackages { |
29
|
0
|
0
|
|
0
|
0
|
|
if( @_ ) { @scannedpackages = @_ } |
|
0
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
return @scannedpackages; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub array_as_str { |
34
|
0
|
|
|
0
|
0
|
|
my @a = $_[0]; |
35
|
0
|
|
|
|
|
|
return (join ("\n", @a)); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub text_symbols { |
39
|
0
|
|
|
0
|
0
|
|
my $p = shift; |
40
|
0
|
|
|
|
|
|
my (@text) = @_; |
41
|
0
|
|
|
|
|
|
my $text = array_as_str (@text); |
42
|
0
|
|
|
|
|
|
my (@ver) = grep /VERSION.*\=/, @text; |
43
|
0
|
|
|
|
|
|
my ($package) = ($text =~ /^package\s+(.*?)\;/ms); |
44
|
0
|
0
|
|
|
|
|
$p -> {packagename} = $package if $package; |
45
|
0
|
|
|
|
|
|
$p -> {version} = $ver[0]; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub pathname { |
49
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
50
|
0
|
0
|
|
|
|
|
if (@_) { $self -> {pathname} = shift; } |
|
0
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
return $self -> {pathname} |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub packagename { |
55
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
56
|
0
|
0
|
|
|
|
|
if (@_) { $self -> {packagename} = shift; } |
|
0
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
return $self -> {packagename} |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub version { |
61
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
62
|
0
|
0
|
|
|
|
|
if (@_) { $self -> {version} = shift; } |
|
0
|
|
|
|
|
|
|
63
|
0
|
|
|
|
|
|
return $self -> {version} |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
1; |
68
|
|
|
|
|
|
|
|