line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/bin/env perl |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
1499
|
use 5.010; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
69
|
|
4
|
2
|
|
|
2
|
|
8
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
53
|
|
5
|
2
|
|
|
2
|
|
15
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
67
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
package Medical::Growth::Base; |
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
8
|
use Scalar::Util qw(openhandle); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
262
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our ($VERSION) = '1.00'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub read_data { |
14
|
5
|
|
|
5
|
1
|
1054
|
my ( $callpkg, $file ) = @_; |
15
|
5
|
|
|
|
|
6
|
my $opened_here = 0; |
16
|
5
|
|
|
|
|
5
|
my ( $fh, $pos, @lines ); |
17
|
5
|
|
|
|
|
16
|
local ( $., $_ ); |
18
|
|
|
|
|
|
|
|
19
|
5
|
100
|
|
|
|
20
|
if ( not defined $file ) { |
|
|
100
|
|
|
|
|
|
20
|
2
|
100
|
|
|
|
7
|
$callpkg = ref $callpkg if ref $callpkg; |
21
|
2
|
|
|
2
|
|
8
|
$fh = do { no strict 'refs'; \*{"${callpkg}::DATA"}; }; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
491
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
7
|
|
22
|
2
|
|
|
|
|
3
|
$pos = tell($fh); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
elsif ( openhandle($file) ) { |
25
|
1
|
|
|
|
|
2
|
$fh = $file; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
else { |
28
|
2
|
100
|
|
|
|
69
|
unless ( open $fh, '<', $file ) { |
29
|
1
|
|
|
|
|
7
|
require Carp; |
30
|
1
|
|
|
|
|
193
|
Carp::croak("Can't read file \"$file\": $!"); |
31
|
|
|
|
|
|
|
} |
32
|
1
|
|
|
|
|
3
|
$opened_here = 1; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
4
|
|
|
|
|
53
|
while (<$fh>) { |
36
|
26
|
100
|
|
|
|
49
|
last if /^__END__/; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
# Simple comment syntax; we don't allow within line |
39
|
|
|
|
|
|
|
# so we don't have to parse for quotes or expressions |
40
|
22
|
100
|
|
|
|
92
|
next if /^(?:#.*|\s*)$/; |
41
|
12
|
|
|
|
|
54
|
push @lines, [split]; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
4
|
100
|
|
|
|
13
|
if ($opened_here) { |
|
|
100
|
|
|
|
|
|
45
|
1
|
|
|
|
|
21
|
close($fh); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
elsif ($pos) { |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# A small twist to restore DATA to initial state when we're done, |
50
|
|
|
|
|
|
|
# so it doesn't appear as part of default error messages. |
51
|
2
|
|
|
|
|
7
|
seek( $fh, $pos, 0 ); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
4
|
|
|
|
|
48
|
return \@lines; |
55
|
|
|
|
|
|
|
} ## end sub read_data |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub measure_class_for { |
58
|
1
|
|
|
1
|
1
|
963
|
require Carp; |
59
|
1
|
|
|
|
|
87
|
Carp::croak("No measure_class_for() method found (called via \"$_[0]\")"); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
__END__ |