line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package B::CompilerPhase::Hook; |
2
|
|
|
|
|
|
|
# ABSTRACT: Programatically install BEGIN/CHECK/INIT/UNITCHECK/END blocks |
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
16586
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
5
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
60
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION; |
8
|
|
|
|
|
|
|
our $AUTHORITY; |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
7
|
use XSLoader; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
131
|
|
11
|
|
|
|
|
|
|
BEGIN { |
12
|
1
|
|
|
1
|
|
3
|
$VERSION = '0.03'; |
13
|
1
|
|
|
|
|
1
|
$AUTHORITY = 'cpan:STEVAN'; |
14
|
1
|
|
|
|
|
467
|
XSLoader::load( __PACKAGE__, $VERSION ); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# now set up the DWIM methods ... |
17
|
1
|
|
|
|
|
4
|
*enqueue_BEGIN = \&append_BEGIN; |
18
|
1
|
|
|
|
|
2
|
*enqueue_CHECK = \&prepend_CHECK; |
19
|
1
|
|
|
|
|
1
|
*enqueue_INIT = \&append_INIT; |
20
|
1
|
|
|
|
|
1
|
*enqueue_UNITCHECK = \&prepend_UNITCHECK; |
21
|
1
|
|
|
|
|
51
|
*enqueue_END = \&prepend_END; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub import { |
25
|
1
|
|
|
1
|
|
5
|
shift; |
26
|
1
|
50
|
|
|
|
9
|
if ( @_ ) { |
27
|
0
|
|
|
|
|
|
my $to = caller; |
28
|
0
|
|
|
|
|
|
my $from = __PACKAGE__; |
29
|
0
|
|
|
|
|
|
foreach ( @_ ) { |
30
|
1
|
|
|
1
|
|
4
|
no strict 'refs'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
66
|
|
31
|
0
|
|
|
|
|
|
*{ $to . '::' . $_ } = $from->can( $_ ); |
|
0
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |