line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Class::DBI::Plugin; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1136
|
use 5.006; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
52
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
43
|
|
5
|
1
|
|
|
1
|
|
1275
|
use attributes (); |
|
1
|
|
|
|
|
1819
|
|
|
1
|
|
|
|
|
134
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = 0.03; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# Code stolen from Simon Cozens (Maypole) |
10
|
|
|
|
|
|
|
our %remember; |
11
|
0
|
|
|
0
|
|
|
sub MODIFY_CODE_ATTRIBUTES { $remember{ $_[1] } = $_[2]; () } |
|
0
|
|
|
|
|
|
|
12
|
0
|
|
|
0
|
|
|
sub FETCH_CODE_ATTRIBUTES { $remember{ $_[1] } } |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub import |
15
|
|
|
|
|
|
|
{ |
16
|
0
|
|
|
0
|
|
|
my $class = shift; |
17
|
0
|
|
|
|
|
|
my $caller = caller; |
18
|
1
|
|
|
1
|
|
10
|
no strict 'refs'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
195
|
|
19
|
0
|
|
|
|
|
|
for my $symname ( keys %{ "$class\::" } ) { |
|
0
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
local *sym = ${ "$class\::" }{ $symname }; |
|
0
|
|
|
|
|
|
|
21
|
0
|
0
|
|
|
|
|
next unless defined &sym; # We're only in it for the subroutines |
22
|
0
|
0
|
|
|
|
|
&sym( $caller ), next |
23
|
|
|
|
|
|
|
if $symname eq 'init'; |
24
|
0
|
0
|
|
|
|
|
*{ "$caller\::$symname" } = \&sym |
|
0
|
|
|
|
|
|
|
25
|
0
|
0
|
|
|
|
|
if grep { defined( $_ ) and $_ eq 'Plugged' } attributes::get( \&sym ); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
__END__ |