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