line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
1609
|
use strict; use warnings; |
|
2
|
|
|
2
|
|
4
|
|
|
2
|
|
|
|
|
65
|
|
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
615
|
|
2
|
|
|
|
|
|
|
package Alt::Assert; |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
sub assert { |
5
|
4
|
|
|
4
|
0
|
4
|
my $self = shift; |
6
|
4
|
|
33
|
|
|
8
|
my $mod = shift || caller(); |
7
|
|
|
|
|
|
|
|
8
|
4
|
100
|
|
|
|
46
|
my ($orig, $phrase) = $mod =~ /^Alt::(\w+(?:::\w+)*)::(\w+)$/ |
9
|
|
|
|
|
|
|
or die "Bad syntax in alternate module name '$mod', should be ". |
10
|
|
|
|
|
|
|
"Alt::::\n"; |
11
|
3
|
|
|
|
|
3
|
my $origf = $orig; |
12
|
3
|
|
|
|
|
4
|
$origf =~ s!::!/!g; $origf .= ".pm"; |
|
3
|
|
|
|
|
3
|
|
13
|
3
|
|
|
|
|
665
|
require $origf; # if user hasn't loaded the module, load it for them |
14
|
|
|
|
|
|
|
|
15
|
3
|
100
|
|
|
|
104
|
defined(&{"$orig\::ALT"}) |
|
3
|
|
|
|
|
39
|
|
16
|
|
|
|
|
|
|
or die "$orig does not define ALT, might not be from the same ". |
17
|
|
|
|
|
|
|
"distribution as $mod\n"; |
18
|
|
|
|
|
|
|
|
19
|
2
|
|
|
|
|
6
|
my $alt = $orig->ALT; |
20
|
2
|
100
|
|
|
|
35
|
$alt eq $phrase |
21
|
|
|
|
|
|
|
or die "$orig has ALT set to '$alt' instead of '$phrase', ". |
22
|
|
|
|
|
|
|
"might not be from the same distribution as $mod\n"; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub import { |
26
|
4
|
|
|
4
|
|
2787
|
my $self = shift; |
27
|
4
|
|
|
|
|
13
|
my $caller = caller(); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# export assert() |
30
|
|
|
|
|
|
|
{ |
31
|
2
|
|
|
2
|
|
12
|
no strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
146
|
|
|
4
|
|
|
|
|
101
|
|
32
|
4
|
|
|
|
|
6
|
*{"$caller\::assert"} = \&assert; |
|
4
|
|
|
|
|
15
|
|
33
|
|
|
|
|
|
|
} |
34
|
4
|
|
|
|
|
9
|
$self->assert($caller); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |