line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Devel::LineName; |
2
|
2
|
|
|
2
|
|
26845
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
140
|
|
3
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
101
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
6
|
|
|
|
|
|
|
$VERSION = eval $VERSION; |
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
18
|
use Carp; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
611
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub import { |
11
|
10
|
|
|
10
|
|
2777
|
my ($pkg, $prag, $hashref) = @_; |
12
|
10
|
|
|
|
|
21
|
my $callpkg = caller(1); |
13
|
|
|
|
|
|
|
|
14
|
10
|
100
|
|
|
|
468
|
defined $hashref or croak "$pkg must be use()ed with two args"; |
15
|
|
|
|
|
|
|
|
16
|
8
|
100
|
|
|
|
164
|
$prag =~ /^\w+\z/ or croak "Invalid $pkg line naming pragma [$prag]"; |
17
|
7
|
100
|
|
|
|
142
|
ref $hashref eq 'HASH' or croak "2nd arg to 'use $pkg' must be a hashref"; |
18
|
|
|
|
|
|
|
|
19
|
6
|
|
|
|
|
11
|
my $filename = $INC{'Devel/LineName.pm'}; |
20
|
6
|
|
66
|
|
|
22
|
$INC{"$prag.pm"} ||= $filename; |
21
|
6
|
100
|
|
|
|
17
|
if ($INC{"$prag.pm"} ne $filename) { |
22
|
1
|
|
|
|
|
124
|
croak "$pkg pragma [$prag] clashes with the $prag module"; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
2
|
|
|
2
|
|
17
|
no strict 'refs'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
64
|
|
26
|
2
|
|
|
2
|
|
9
|
no warnings 'redefine'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
241
|
|
27
|
5
|
|
|
|
|
149
|
*{$prag.'::import'} = sub { |
28
|
13
|
|
|
13
|
|
63
|
my ($pkg, $linename, $offset) = @_; |
29
|
13
|
|
100
|
|
|
41
|
$offset ||= 0; |
30
|
|
|
|
|
|
|
|
31
|
13
|
|
|
|
|
2895
|
$hashref->{$linename} = (caller(1))[2] + $offset; |
32
|
5
|
|
|
|
|
28
|
}; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |