line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Sledge::Plugin::Stash; |
2
|
1
|
|
|
1
|
|
30627
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
79
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
118
|
|
4
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
5
|
1
|
|
|
1
|
|
6
|
use Carp; |
|
1
|
|
|
|
|
18
|
|
|
1
|
|
|
|
|
115
|
|
6
|
1
|
|
|
1
|
|
37
|
use 5.008001; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
67
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub import { |
9
|
1
|
|
|
1
|
|
10
|
my $pkg = caller(0); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
{ |
12
|
1
|
|
|
1
|
|
7
|
no strict 'refs'; ## no critic |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
215
|
|
|
1
|
|
|
|
|
3
|
|
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
|
|
7
|
*{"$pkg\::stash"} = sub :lvalue { |
15
|
0
|
|
|
0
|
|
0
|
my ($self, ) = @_; |
16
|
0
|
|
|
|
|
0
|
$self->{stash}; |
17
|
1
|
|
|
|
|
5
|
}; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
$pkg->add_trigger( |
21
|
|
|
|
|
|
|
AFTER_INIT => sub { |
22
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
23
|
0
|
|
|
|
|
0
|
$self->stash = {}; |
24
|
|
|
|
|
|
|
}, |
25
|
1
|
|
|
|
|
8
|
); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
$pkg->add_trigger( |
28
|
|
|
|
|
|
|
BEFORE_OUTPUT => sub { |
29
|
0
|
|
|
0
|
|
|
my $self = shift; |
30
|
0
|
|
|
|
|
|
$self->tmpl->param( %{ $self->stash } ); |
|
0
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
} |
32
|
1
|
|
|
|
|
9
|
); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
__END__ |