Module.pm

filter: Statementstmt 11.9% 31 / 259 Branchbran 0.0% 0 / 94 Conditioncond 0.0% 0 / 18 MC/DCmcdc 0.0% 0 / 12 Subroutinesub 22.8% 8 / 35 Podpod 34.6% 9 / 26 totaltotal 10.8% 48 / 444 CC 69 SCAR 37.7
CC
69
Cov
8%
pathname
110.0
retrieve
90.0
exportedkeys
90.0
CRAP 43.4
↑ Summary ModuleSymbol.pm »
1 package Lib::Module;
2 # $Id: Module.pm,v 1.13 2004/03/28 02:22:23 kiesling Exp $
3 1 $VERSION=0.70;
4 1 ▶use vars qw( @ISA @EXPORT @EXPORT_OK $VERSION );
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 push @ISA, qw(Exporter);
6  
7 1 @EXPORT_OK = qw($VERSION &libdirs &module_paths &scanlibs &retrieve
8 &pathname &usesTk &ModuleVersion &PathName &BaseName
9 &PackageName &Supers);
10  
11 1 require Exporter;
12 1 require Carp;
13 1 ▶use File::Basename;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use Lib::ModuleSymbol;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 1 ▶use Lib::SymbolRef;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 1 ▶use IO::Handle;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 1 ▶use DB;
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 1 my @modulepathnames;
20 my @libdirectories;
21  
22 =head1 NAME
23  
24 Lib::Module.pm - Perl library module utilities.
25  
26 =head1 SYNOPSIS
27  
28 use Lib::Module;
29  
30 my $m = new Lib::Module; # Create a module object.
31  
32 # Create the class library hierarchy.
33 $m -> libdirs ($verbose);
34 $m -> module_paths ($verbose);
35 $m -> scanlibs ($verbose);
36  
37 # Retrieve the module object for a package.
38 my $m2 = $m -> retrieve ("Tk::Browser");
39  
40 print $m2 -> PathName . "\n" .
41 $m2 -> BaseName . "\n" .
42 $m2 -> PackageName . "\n" .
43 $m2 -> ModuleVersion . "\n" .
44 $m2 -> Supers . "\n";
45  
46 # Return the file path name of a module.
47 my $path = $m -> pathname ("Tk::Browser");
48  
49  
50  
51 =head1 DESCRIPTION
52  
53 A Lib::Module object describes a Perl library module and includes the
54 module's package name, file name, version, and superclasses, if any.
55  
56 The module objects are normally part of a class hierarchy generated by
57 libdirs (), module_paths (), and scanlibs (). Every module is a
58 subclass of UNIVERSAL, Perl's default superclass.
59  
60 =head1 METHODS
61  
62 =head2 ModuleVersion
63  
64 Return the module's b<$VERSION => line.
65  
66 =head2 PathName ($name)
67  
68 Return the module's path.
69  
70 =head2 BaseName ($name)
71  
72 Return the module's file basename.
73  
74 =head2 PackageName ($name)
75  
76 Return the argument of the module's B<package> function.
77  
78 =head2 retrieve (I<basename> || I<packagename>)
79  
80 The retrieve ($name) method returns the Lib::Module object or undef.
81  
82 my $new = $m -> retrieve ("Optional::Module");
83  
84 if (!defined $new) {
85 print "Can't find Optional::Module.\n"
86 }
87  
88 B<Retrieve> matches the first part of the module's name. If B<retrieve>
89 doesn't match a sub-module, specify only the sub-module's name; e.g.,
90 'Module' instead of 'Optional::Module'.
91  
92 =head2 Supers ()
93  
94 Returns the module's superclasses; i.e, the arguments of an @ISA
95 declaration.
96  
97 =head1 EXPORTS
98  
99 See the @EXPORTS_OK array.
100  
101 =head1 BUGS
102  
103 Does not take into account all of the possible module naming schemes
104 when retrieving modules.
105  
106 =head1 VERSION
107  
108 VERSION 0.69
109  
110 =head1 COPYRIGHT
111  
112 Copyright © 2001-2004 Robert Kiesling, rkies@cpan.org.
113  
114 Licensed under the same terms as Perl. Refer to the file,
115 "Artistic," for information.
116  
117 =head1 SEE ALSO
118  
119 perl(1), Tk::Browser(3)
120  
121 =cut
122  
123 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
124 0 my $proto = shift;
125 0 ▶ my $class = ref( $proto ) || $proto;
Condition0%0/3
ref $proto || $proto
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $proto || $proto
ref $proto $proto
Truth table0%0/3
A || B
A= ref $protoB= $proto
ABresult
1X1
011
000
126 0 my $self = {
127 children => [],
128 parents => '',
129 pathname => '',
130 basename => '',
131 packagename => '',
132 version => '',
133 superclasses => undef,
134 baseclass => '',
135 moduleinfo => undef,
136 symbols => []
137 };
138 0 bless( $self, $class);
139 0 return $self;
140 }
141  
142 # Given a file base name, return the Module object.
143 1 ▶no warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
144 0 ▶sub retrieve {
Subroutine retrieve: not called CC=9 SCAR=45.0
Pod documented
145 0 my $parent = shift;
146 0 my ($n) = @_;
147 0 ▶ if ( $parent -> {basename} =~ /^$n$/ || $_ -> {packagename} =~ /^$n$/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($parent->{"basename"} =~ /^$n$/ or $_->{"packagename"} =~ /^$n$/) 0 0 0
Condition0%0/3
$parent->{"basename"} =~ /^$n$/ or $_->{"packagename"} =~ /^$n$/
l!l&&r!l&&!r
000
MC/DC0%0/2
$parent->{"basename"} =~ /^$n$/ or $_->{"packagename"} =~ /^$n$/
$parent->{"basename"} =~ /^$n$/ $_->{"packagename"} =~ /^$n$/
Truth table0%0/3
A or B
A= $parent->{"basename"} =~ /^$n$/B= $_->{"packagename"} =~ /^$n$/
ABresult
1X1
011
000
148 0 return $parent;
149 }
150 0 foreach ( @{$parent -> {children}} ) {
151 return $_
152 0 ▶ if ( $_ -> {basename} =~ /^$n$/ || $_ -> {packagename} =~ /^$n/);
Branch: 1 branch
BranchTrueFalseTotal
if $_->{"basename"} =~ /^$n$/ or $_->{"packagename"} =~ /^$n/ 0 0 0
Condition0%0/3
$_->{"basename"} =~ /^$n$/ or $_->{"packagename"} =~ /^$n/
l!l&&r!l&&!r
000
MC/DC0%0/2
$_->{"basename"} =~ /^$n$/ or $_->{"packagename"} =~ /^$n/
$_->{"basename"} =~ /^$n$/ $_->{"packagename"} =~ /^$n/
Truth table0%0/3
A or B
A= $_->{"basename"} =~ /^$n$/B= $_->{"packagename"} =~ /^$n/
ABresult
1X1
011
000
153 }
154 0 ▶ foreach ( @{$parent -> {children}} && $_ -> {packagename} =~ /^$n/) {
Condition0%0/3
@{$parent->{'children'};} && $_->{'packagename'} =~ /^$n/
!ll&&!rl&&r
000
MC/DC0%0/2
@{$parent->{'children'};} && $_->{'packagename'} =~ /^$n/
@{$parent->{'children'};} $_->{'packagename'} =~ /^$n/
Truth table0%0/3
A && B
A= @{$parent->{'children'};}B= $_->{'packagename'} =~ /^$n/
ABresult
0X0
100
111
155 0 ▶ return $_ if (retrieve( $_, $n ));
Branch: 1 branch
BranchTrueFalseTotal
if retrieve($_, $n) 0 0 0
156 }
157 0 return undef;
158 }
159 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
160  
161 0 ▶sub pathname {
Subroutine pathname: not called CC=10 SCAR=47.0
Pod undocumented
162 0 my $self = shift;
163 0 my $name = $_[0];
164 0 my $verbose = $_[1];
165 0 ▶ autoflush STDOUT 1 if $verbose;
Branch: 1 branch
BranchTrueFalseTotal
if $verbose 0 0 0
166 0 ▶ if ($self -> {basename} =~ /^$name/ || $self->{packagename} =~ /^$name/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"basename"} =~ /^$name/ or $self->{"packagename"} =~ /^$name/) 0 0 0
Condition0%0/3
$self->{"basename"} =~ /^$name/ or $self->{"packagename"} =~ /^$name/
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->{"basename"} =~ /^$name/ or $self->{"packagename"} =~ /^$name/
$self->{"basename"} =~ /^$name/ $self->{"packagename"} =~ /^$name/
Truth table0%0/3
A or B
A= $self->{"basename"} =~ /^$name/B= $self->{"packagename"} =~ /^$name/
ABresult
1X1
011
000
167 0 return $self -> {pathname}; }
168 0 foreach ( @{$self -> {children}} ) {
169 0 ▶ print '.' if $verbose;
Branch: 1 branch
BranchTrueFalseTotal
if $verbose 0 0 0
170 0 ▶ if ($_ -> {basename} =~ /^$name/ || $self->{packagename} =~ /^$name/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_->{"basename"} =~ /^$name/ or $self->{"packagename"} =~ /^$name/) 0 0 0
Condition0%0/3
$_->{"basename"} =~ /^$name/ or $self->{"packagename"} =~ /^$name/
l!l&&r!l&&!r
000
MC/DC0%0/2
$_->{"basename"} =~ /^$name/ or $self->{"packagename"} =~ /^$name/
$_->{"basename"} =~ /^$name/ $self->{"packagename"} =~ /^$name/
Truth table0%0/3
A or B
A= $_->{"basename"} =~ /^$name/B= $self->{"packagename"} =~ /^$name/
ABresult
1X1
011
000
171 0 return $_ -> {pathname};
172 }
173 }
174 0 foreach ( @{$self -> {children}} ) {
175 0 ▶ if ( pathname ( $_, $name ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (pathname($_, $name)) 0 0 0
176 0 return $_ -> {pathname}; }
177 }
178 0 return undef;
179 }
180  
181 # Given a module package or sub-package name, return the module object.
182 # It's probably desirable to use this in preference to retrieve,
183 # with external calls, to avoid dealing with the library pathnames
184 # unless necessary.
185 0 ▶sub retrieve_module {
Subroutine retrieve_module: not called CC=6 SCAR=37.4
Pod undocumented
186 0 my $parent = shift;
187 0 my ($n) = @_;
188 0 ▶ if ( $parent -> {packagename} eq $n ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($parent->{"packagename"} eq $n) 0 0 0
189 0 return $parent; }
190 0 foreach ( @{$parent -> {children}} ) {
191 0 ▶ if ( $_ -> {packagename} eq $n ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_->{"packagename"} eq $n) 0 0 0
192 0 return $_;
193 }
194 }
195 0 foreach ( @{$parent -> {children}} ) {
196 0 ▶ if ( retrieve( $_, $n ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (retrieve($_, $n)) 0 0 0
197 0 return $_; }
198 }
199 0 return undef;
200 }
201  
202 0 ▶sub modulepathnames {
Subroutine modulepathnames: not called CC=1 SCAR=6.9
Pod undocumented
203 0 my $self = shift;
204 0 return @modulepathnames;
205 }
206  
207 0 ▶sub libdirectories {
Subroutine libdirectories: not called CC=1 SCAR=6.9
Pod undocumented
208 0 my $self = shift;
209 0 return @libdirectories;
210 }
211  
212 0 ▶sub scanlibs {
Subroutine scanlibs: not called CC=7 SCAR=40.3
Pod undocumented
213 0 my $b = shift;
214 0 my $verbose = $_[0];
215 0 my $m;
216 0 my ($path, $bname, $ext);
217 0 ▶ autoflush STDOUT 1 if $verbose;
Branch: 1 branch
BranchTrueFalseTotal
if $verbose 0 0 0
218 0 LOOP: foreach my $i ( @modulepathnames ) {
219 0 ▶ print '.' if $verbose;
Branch: 1 branch
BranchTrueFalseTotal
if $verbose 0 0 0
220 0 ($bname, $path, $ext) = fileparse($i, qw(\.pm$ \.pl$) );
221 # Don't use RCS Archives or Emacs bacups
222 0 ▶ if( $bname =~ /(,v)|~/ ) { next LOOP; }
Branch: 1 branch
BranchTrueFalseTotal
if ($bname =~ /(,v)|~/) 0 0 0
223 0 ▶ if( $bname =~ /UNIVERSAL/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($bname =~ /UNIVERSAL/) { } 0 0 0
224 0 $b -> modinfo( $i );
225 } else {
226 0 $m = new Lib::Module;
227 0 ▶ next LOOP if ! $m -> modinfo( $i );
Branch: 1 branch
BranchTrueFalseTotal
unless $m->modinfo($i) 0 0 0
228 0 $m -> {parents} = $b;
229 0 push @{$b -> {children}}, ($m);
230 }
231 }
232 }
233  
234 0 ▶sub modinfo {
Subroutine modinfo: not called CC=4 SCAR=30.0
Pod undocumented
235 0 my $self = shift;
236 0 my ($path) = @_;
237 0 my ($dirs, $bname, $ext);
238 0 my ($supers, $pkg, $ver, @text, @matches);
239 0 ($bname, $dirs, $ext) = fileparse($path, qw(\.pm \.pl));
240 0 $self -> {pathname} = $path;
241 0 @text = $self -> readfile;
242 0 my $p = new Lib::ModuleSymbol;
243 0 $p -> {pathname} = $path;
244 0 $p -> text_symbols( @text );
245 0 ▶ $self -> {version} = $p -> {version} if $p -> {version};
Branch: 1 branch
BranchTrueFalseTotal
if $p->{"version"} 0 0 0
246 0 $self -> {moduleinfo} = $p ;
247 0 $self -> {packagename} = $p -> {packagename};
248 # We do a static match here because it's faster
249 # Todo: include base classes from "use base" statements.#
250 0 @matches = grep /^(our|my|push)+\s+\@ISA(.*?)\;/, @text;
251 0 $supers = $matches[0];
252 0 ▶ $supers =~ s/\@ISA|push|our|my|(qw)|[=\(\)\;]//gms if $supers;
Branch: 1 branch
BranchTrueFalseTotal
if $supers 0 0 0
253 0 ▶ $supers =~ s/\W*// if $supers;
Branch: 1 branch
BranchTrueFalseTotal
if $supers 0 0 0
254 0 $self -> {basename} = $bname;
255 0 $self -> {superclasses} = $supers;
256 0 return 1;
257 }
258  
259 # See the perlmod manpage
260 # Returns a hash of symbol => values.
261 # Handles as separate ref.
262 # Typeglob dereferencing deja Symdump.pm and dumpvar.pl, et al.
263 # Package namespace creation and module loading per base.pm.
264 0 ▶sub exportedkeys {
Subroutine exportedkeys: not called CC=9 SCAR=45.0
Pod undocumented
265 0 my $m = shift;
266 0 my ($pkg) = @_;
267 0 my $obj;
268 0 my $key; my $val;
269 0 my $rval;
270 0 my $nval;
271 0 my %keylist = ();
272 0 $m -> {symbols} = ();
273 0 my @vallist;
274 0 my $i = 0;
275 0 EACHKEY: foreach $key( keys %{*{"$pkg"}} ) {
276 0 ▶ next unless $key;
Branch: 1 branch
BranchTrueFalseTotal
unless $key 0 0 0
277 0 ▶ if( defined ($val = ${*{"$pkg"}}{$key} ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($val = do { *{"$pkg";} }->{$key})) 0 0 0
278 0 $rval = $val; $nval = $val;
279 0 $obj = tie $rval, 'Lib::SymbolRef', $nval;
280 0 push @{$m -> {symbols}}, ($obj);
281 0 ▶ foreach( @vallist) { if ( $_ eq $rval ) { next EACHKEY } }
Branch: 1 branch
BranchTrueFalseTotal
if ($_ eq $rval) 0 0 0
282 # Replace the static $VERSION and @ISA values
283 # of the initial library scan with the symbol
284 # compile/run-time values.
285 0 local (*v) = $val;
286 # Look for the stash values in case they've changed
287 # from the source scan.
288 0 ▶ if( $key =~ /VERSION/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($key =~ /VERSION/) 0 0 0
289 0 $m -> {version} = ${*v{SCALAR}};
290 }
291 0 ▶ if($key =~ /ISA/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($key =~ /ISA/) 0 0 0
292 0 $m -> {superclasses} = "@{*v{ARRAY}}";
293 }
294 }
295 }
296 0 ▶ $keylist{$key} = ${*{"$pkg"}}{$key} if $key;
Branch: 1 branch
BranchTrueFalseTotal
if $key 0 0 0
297 # for dumping symbol refs to STDOUT.
298 # example of how to print listing of symbol refs.
299 # foreach my $i ( @{$m -> {symbols}} ) {
300 # foreach( @{$i -> {name}} ) {
301 # print $_;
302 # }
303 # print "\n--------\n";
304 # }
305 0 return %keylist;
306 }
307  
308 #
309 # Here for example only. This function (or the statements
310 # it contains), must be in the package that has the main:: stash
311 # space in order to list the packages symbols into the correct
312 # stash context.
313 #
314 # sub modImport {
315 # my ($pkg) = @_;
316 # eval "package $pkg";
317 # eval "use $pkg";
318 # eval "require $pkg";
319 #}
320  
321 0 ▶sub readfile {
Subroutine readfile: not called CC=3 SCAR=24.8
Pod undocumented
322 0 my $self = shift;
323 0 my $fn;
324 0 ▶ if (@_){ ($fn) = @_; } else { $fn = $self -> PathName; }
Branch: 1 branch
BranchTrueFalseTotal
if (@_) { } 0 0 0
325 0 my @text;
326 0 ▶ open FILE, $fn or warn "Couldn't open file $fn: $!.\n";
Branch: 1 branch
BranchTrueFalseTotal
open FILE, $fn or warn "Couldn't open file ${fn}: $!.\n" 0 0 0
327 0 @text = <FILE>;
328 0 close FILE;
329 0 return @text;
330 }
331  
332 # de-allocate module and all its children
333 0 ▶sub DESTROY ($) {
Subroutine DESTROY: not called CC=3 SCAR=24.8
334 0 my ($m) = @_;
335 0 @c = $m -> {children};
336 0 $d = @c;
337 0 ▶ if ( $d == 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($d == 0) 0 0 0
338 0 $m = {
339 children => undef
340 };
341 0 return;
342 }
343 0 foreach my $i ( @{$m -> {children}} ) {
344 0 Lib::Module -> DESTROY($i);
345 }
346 }
347  
348 0 ▶sub libdirs {
Subroutine libdirs: not called CC=8 SCAR=42.8
Pod undocumented
349 0 my $self = shift;
350 0 my $verbose = $_[0];
351 0 my $f; my $f2;
352 0 my $d;
353 0 ▶ autoflush STDOUT 1 if $verbose;
Branch: 1 branch
BranchTrueFalseTotal
if $verbose 0 0 0
354 0 foreach $d ( @INC ) {
355 0 push @libdirectories, ($d);
356 0 ▶ print '.' if $verbose;
Branch: 1 branch
BranchTrueFalseTotal
if $verbose 0 0 0
357 0 opendir DIR, $d;
358 0 @dirfiles = readdir DIR;
359 0 closedir DIR;
360 # look for subdirs of the directories in @INC.
361 0 foreach $f ( @dirfiles ) {
362 0 ▶ next if $f =~ m/^\.{1,2}$/ ;
Branch: 1 branch
BranchTrueFalseTotal
if $f =~ /^\.{1,2}$/ 0 0 0
363 0 $f2 = $d . '/' . $f;
364 0 ▶ if (opendir SUBDIR, $f2 ) {
Branch: 1 branch
BranchTrueFalseTotal
if (opendir SUBDIR, $f2) 0 0 0
365 0 push @libdirectories, ($f2);
366 0 ▶ print '.' if $verbose;
Branch: 1 branch
BranchTrueFalseTotal
if $verbose 0 0 0
367 0 libsubdir( $f2 );
368 0 closedir SUBDIR;
369 }
370 }
371 }
372 }
373  
374 0 ▶sub libsubdir {
Subroutine libsubdir: not called CC=5 SCAR=34.0
Pod undocumented
375 0 my ($parent) = @_;
376 0 opendir DIR, $parent;
377 0 my @dirfiles = readdir DIR;
378 0 closedir DIR;
379 0 foreach (@dirfiles) {
380 0 ▶ next if $_ =~ m/^\.{1,2}$/ ;
Branch: 1 branch
BranchTrueFalseTotal
if $_ =~ /^\.{1,2}$/ 0 0 0
381 0 my $f2 = $parent . '/' . $_;
382 0 ▶ if (opendir SUBDIR, $f2 ) {
Branch: 1 branch
BranchTrueFalseTotal
if (opendir SUBDIR, $f2) 0 0 0
383 0 push @libdirectories, ($f2);
384 0 ▶ print '.' if $verbose;
Branch: 1 branch
BranchTrueFalseTotal
if $verbose 0 0 0
385 0 libsubdir( $f2 );
386 0 closedir SUBDIR;
387 }
388 }
389 }
390  
391 0 ▶sub module_paths {
Subroutine module_paths: not called CC=4 SCAR=30.0
Pod undocumented
392 0 my $self = shift;
393 0 my ($f, $pathname, @allfiles);
394 0 foreach ( @libdirectories ) {
395 0 opendir DIR, $_;
396 0 @allfiles = readdir DIR;
397 0 closedir DIR;
398 0 foreach $f ( @allfiles ) {
399 0 ▶ if ( $f =~ /\.p[lm]/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($f =~ /\.p[lm]/) 0 0 0
400 0 $pathname = $_ . '/' . $f;
401 0 push @modulepathnames, ($pathname);
402 }
403 }
404 }
405 }
406  
407 0 ▶sub Children {
Subroutine Children: not called CC=2 SCAR=17.9
Pod undocumented
408 0 my $self = shift;
409 0 ▶ if (@_) { $self -> {children} = shift; }
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
410 return $self -> {children}
411 0 }
412  
413 0 ▶sub Parents {
Subroutine Parents: not called CC=2 SCAR=17.9
Pod undocumented
414 0 my $self = shift;
415 0 ▶ if (@_) { $self -> {parents} = shift; }
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
416 return $self -> {parents}
417 0 }
418  
419 0 ▶sub PathName {
Subroutine PathName: not called CC=2 SCAR=17.9
Pod documented
420 0 my $self = shift;
421 0 ▶ if (@_) { $self -> {pathname} = shift; }
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
422 return $self -> {pathname}
423 0 }
424  
425 0 ▶sub BaseName {
Subroutine BaseName: not called CC=2 SCAR=17.9
Pod documented
426 0 my $self = shift;
427 0 ▶ if (@_) { $self -> {basename} = shift; }
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
428 return $self -> {basename}
429 0 }
430  
431 0 ▶sub ModuleVersion {
Subroutine ModuleVersion: not called CC=1 SCAR=6.9
Pod documented
432 0 my $self = shift;
433 0 return $self -> {moduleinfo} -> {version};
434 }
435  
436 0 ▶sub PackageName {
Subroutine PackageName: not called CC=2 SCAR=17.9
Pod documented
437 0 my $self = shift;
438 0 ▶ if (@_) { $self -> {packagename} = shift; }
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
439 return $self -> {packagename}
440 0 }
441  
442 0 ▶sub Symbols {
Subroutine Symbols: not called CC=2 SCAR=17.9
Pod documented
443 0 my $self = shift;
444 0 ▶ if (@_) { $self -> {symbols} = shift; }
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
445 return $self -> {symbols}
446 0 }
447  
448 ###
449 ### Version, SuperClass -- Module.pm uses hashref directly.
450 ###
451 0 ▶sub Version {
Subroutine Version: not called CC=2 SCAR=17.9
Pod documented
452 0 my $self = shift;
453 0 ▶ if (@_) { $self -> {version} = shift; }
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
454 return $self -> {version}
455 0 }
456  
457 0 ▶sub SuperClasses {
Subroutine SuperClasses: not called CC=2 SCAR=17.9
Pod undocumented
458 0 my $self = shift;
459 0 ▶ if (@_) { $self -> {superclasses} = shift; }
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
460 return $self -> {superclasses}
461 0 }
462  
463 0 ▶sub BaseClass {
Subroutine BaseClass: not called CC=2 SCAR=17.9
Pod undocumented
464 0 my $self = shift;
465 0 ▶ if (@_) { $self -> {baseclass} = shift; }
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
466 return $self -> {baseclass}
467 0 }
468  
469 0 ▶sub ModuleInfo {
Subroutine ModuleInfo: not called CC=2 SCAR=17.9
Pod undocumented
470 0 my $self = shift;
471 0 ▶ if (@_) { $self -> {moduleinfo} = shift; }
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
472 return $self -> {moduleinfo}
473 0 }
474  
475 0 ▶sub Supers {
Subroutine Supers: not called CC=1 SCAR=6.9
Pod documented
476 0 my $self = shift;
477 0 return $self -> {superclasses};
478 }
479  
480 0 ▶sub Import {
Subroutine Import: not called CC=1 SCAR=6.9
Pod documented
481 0 my ($pkg) = @_;
482 0 &Exporter::import( $pkg );
483 }
484  
485 1 1;
486  
↑ Summary ModuleSymbol.pm »