line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Hook::Heckle;
|
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6939
|
use 5.006;
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
40
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
5
|
1
|
|
|
1
|
|
6
|
use warnings;
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
70
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.01.01';
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $DEBUG = 0;
|
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
858
|
use Class::Maker;
|
|
1
|
|
|
|
|
12375
|
|
|
1
|
|
|
|
|
7
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Class::Maker::class
|
14
|
|
|
|
|
|
|
{
|
15
|
|
|
|
|
|
|
public =>
|
16
|
|
|
|
|
|
|
{
|
17
|
|
|
|
|
|
|
string => [qw( victim context )],
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
ref => [qw( pre post )],
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
array => [qw( result )],
|
22
|
|
|
|
|
|
|
}
|
23
|
|
|
|
|
|
|
};
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub __pre
|
26
|
|
|
|
|
|
|
{
|
27
|
2
|
|
|
2
|
|
5
|
my $this = shift;
|
28
|
|
|
|
|
|
|
}
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub __post
|
31
|
|
|
|
|
|
|
{
|
32
|
2
|
|
|
2
|
|
4
|
my $this = shift;
|
33
|
|
|
|
|
|
|
}
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub _preinit : method
|
36
|
|
|
|
|
|
|
{
|
37
|
2
|
|
|
2
|
|
883
|
my $this = shift;
|
38
|
|
|
|
|
|
|
|
39
|
2
|
|
|
|
|
8
|
$this->context( 'main' );
|
40
|
|
|
|
|
|
|
|
41
|
2
|
|
|
0
|
|
37
|
$this->pre( sub { } );
|
|
0
|
|
|
|
|
0
|
|
42
|
|
|
|
|
|
|
|
43
|
2
|
|
|
0
|
|
17
|
$this->post( sub { } );
|
|
0
|
|
|
|
|
0
|
|
44
|
|
|
|
|
|
|
}
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub _postinit : method
|
47
|
|
|
|
|
|
|
{
|
48
|
2
|
|
|
2
|
|
142
|
my $this = shift;
|
49
|
|
|
|
|
|
|
|
50
|
2
|
|
|
|
|
8
|
my $method = sprintf '%s::%s', $this->context, $this->victim;
|
51
|
|
|
|
|
|
|
|
52
|
2
|
50
|
|
|
|
23
|
die "$this victim param is a must" unless $method;
|
53
|
|
|
|
|
|
|
|
54
|
2
|
50
|
|
|
|
6
|
printf "%s postinit called for '%s'\n", ref $this, $method if $DEBUG;
|
55
|
|
|
|
|
|
|
|
56
|
1
|
|
|
1
|
|
465
|
no strict 'refs';
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
39
|
|
57
|
1
|
|
|
1
|
|
7
|
no warnings;
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
202
|
|
58
|
|
|
|
|
|
|
|
59
|
2
|
|
|
|
|
2
|
my $orig = *{ $method }{CODE};
|
|
2
|
|
|
|
|
9
|
|
60
|
|
|
|
|
|
|
|
61
|
2
|
|
|
|
|
9
|
*{ $method } = sub {
|
62
|
|
|
|
|
|
|
|
63
|
2
|
|
|
2
|
|
16
|
my $this = $this;
|
64
|
|
|
|
|
|
|
|
65
|
2
|
|
|
|
|
17
|
__pre( $this, @_ );
|
66
|
|
|
|
|
|
|
|
67
|
2
|
|
|
|
|
7
|
$this->pre->( $this, @_ );
|
68
|
|
|
|
|
|
|
|
69
|
2
|
|
|
|
|
60
|
my @result = $orig->( @_ );
|
70
|
|
|
|
|
|
|
|
71
|
2
|
|
|
|
|
32
|
$this->result( @result );
|
72
|
|
|
|
|
|
|
|
73
|
2
|
|
|
|
|
35
|
$this->post->( $this, @_ );
|
74
|
|
|
|
|
|
|
|
75
|
2
|
|
|
|
|
63
|
__post( $this, @_ );
|
76
|
|
|
|
|
|
|
|
77
|
2
|
|
|
|
|
5
|
return @result;
|
78
|
2
|
|
|
|
|
8
|
};
|
79
|
|
|
|
|
|
|
|
80
|
2
|
|
|
|
|
5
|
return $this;
|
81
|
|
|
|
|
|
|
}
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
1;
|
84
|
|
|
|
|
|
|
__END__
|