line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package name; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
155846
|
use 5.008; |
|
3
|
|
|
|
|
18
|
|
4
|
3
|
|
|
3
|
|
12
|
use strict; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
69
|
|
5
|
3
|
|
|
3
|
|
12
|
use warnings; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
67
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
12
|
use Carp 'croak'; |
|
3
|
|
|
|
|
46
|
|
|
3
|
|
|
|
|
173
|
|
8
|
3
|
|
|
3
|
|
793
|
use Sub::Util qw(set_prototype set_subname); |
|
3
|
|
|
|
|
517
|
|
|
3
|
|
|
|
|
355
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = 'v0.0.1'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub import { |
13
|
9
|
|
|
9
|
|
6586
|
my $me = shift; |
14
|
9
|
100
|
|
|
|
297
|
my $name = shift or croak "$me: no name given"; |
15
|
7
|
|
|
|
|
15
|
my %args = @_; |
16
|
|
|
|
|
|
|
my $alias = $args{alias} |
17
|
7
|
100
|
|
|
|
313
|
or croak "$me: An 'alias' is required with 'use name'"; |
18
|
3
|
|
|
|
|
11
|
my $caller = caller; |
19
|
|
|
|
|
|
|
|
20
|
3
|
|
|
3
|
|
16
|
no strict 'refs'; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
129
|
|
21
|
3
|
|
|
3
|
|
14
|
no warnings 'redefine'; |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
302
|
|
22
|
|
|
|
|
|
|
|
23
|
3
|
|
|
|
|
27
|
*{"${caller}::$name"} = |
24
|
|
|
|
|
|
|
set_subname "${caller}::$name", |
25
|
|
|
|
|
|
|
set_prototype '', |
26
|
|
|
|
|
|
|
sub { |
27
|
2
|
|
|
2
|
|
3176
|
return $alias; |
|
|
|
|
2
|
|
|
|
28
|
3
|
|
|
|
|
30
|
}; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; # End of name |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
__END__ |