line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CGI::Application::Plugin::AbstractCallback; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
56581
|
use strict; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
129
|
|
4
|
2
|
|
|
2
|
|
16
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
104
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
24
|
use Carp; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
170
|
|
9
|
2
|
|
|
2
|
|
22
|
use CGI::Application; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
173
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub import { |
12
|
2
|
|
|
2
|
|
26
|
my $class = shift; |
13
|
2
|
|
|
|
|
5
|
my $hook = shift; |
14
|
|
|
|
|
|
|
|
15
|
2
|
|
|
|
|
5
|
my $caller = scalar caller; |
16
|
|
|
|
|
|
|
|
17
|
2
|
50
|
33
|
|
|
29
|
if (UNIVERSAL::isa($caller, 'CGI::Application') && defined $hook) { |
18
|
2
|
|
|
|
|
4
|
eval { |
19
|
2
|
|
|
2
|
|
10
|
no strict 'refs'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
309
|
|
20
|
|
|
|
|
|
|
# $caller->add_callback($hook, \&{$class . '::callback'}); |
21
|
2
|
|
|
|
|
41
|
$caller->add_callback($hook, $class->can('callback')); |
22
|
|
|
|
|
|
|
}; |
23
|
2
|
50
|
|
|
|
81
|
if ($@) { |
24
|
0
|
|
|
|
|
|
carp $@; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
else { |
28
|
0
|
|
|
|
|
|
carp "Invalid call from package is't a CGI::Application, or not defined hook $hook"; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub callback { |
33
|
0
|
|
|
0
|
1
|
|
my CGI::Application $self = shift; |
34
|
0
|
|
|
|
|
|
my %args = @_; |
35
|
|
|
|
|
|
|
# no action |
36
|
|
|
|
|
|
|
# please override me |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
__END__ |