line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Meta::Builder::Util; |
2
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
58
|
|
3
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
208
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub import { |
6
|
4
|
|
|
4
|
|
8
|
my $class = shift; |
7
|
4
|
|
|
|
|
15
|
my $caller = caller; |
8
|
4
|
|
|
|
|
83
|
inject( $caller, "inject", \&inject ); |
9
|
|
|
|
|
|
|
} |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub inject { |
12
|
100
|
|
|
100
|
1
|
186
|
my ( $class, $sub, $code, $nowarn ) = @_; |
13
|
100
|
100
|
|
|
|
173
|
if ( $nowarn ) { |
14
|
2
|
|
|
2
|
|
21
|
no strict 'refs'; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
60
|
|
15
|
2
|
|
|
2
|
|
9
|
no warnings 'redefine'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
127
|
|
16
|
14
|
|
|
|
|
15
|
*{"$class\::$sub"} = $code; |
|
14
|
|
|
|
|
129
|
|
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
else { |
19
|
2
|
|
|
2
|
|
14
|
no strict 'refs'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
137
|
|
20
|
86
|
|
|
|
|
91
|
*{"$class\::$sub"} = $code; |
|
86
|
|
|
|
|
797
|
|
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
__END__ |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 NAME |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
Meta::Builder::Util - Utility functions for Meta::Builder |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 EXPORTS |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=over 4 |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=item inject( $class, $name, $code, $redefine ) |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
used to inject a sub into a namespace. |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=back |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 AUTHORS |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Chad Granum L<exodist7@gmail.com> |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 COPYRIGHT |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Copyright (C) 2010 Chad Granum |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
Meta-Builder is free software; Standard perl licence. |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Meta-Builder is distributed in the hope that it will be useful, but WITHOUT |
53
|
|
|
|
|
|
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
54
|
|
|
|
|
|
|
FOR A PARTICULAR PURPOSE. See the license for more details. |