| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Die::Hard; |
|
2
|
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
39987
|
use 5.008; |
|
|
1
|
|
|
|
|
6
|
|
|
|
1
|
|
|
|
|
40
|
|
|
4
|
1
|
|
|
1
|
|
2623
|
use Moo; |
|
|
1
|
|
|
|
|
38407
|
|
|
|
1
|
|
|
|
|
8
|
|
|
5
|
1
|
|
|
1
|
|
2515
|
use Scalar::Util (); |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
18
|
|
|
6
|
1
|
|
|
1
|
|
5
|
use Carp (); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
30
|
|
|
7
|
1
|
|
|
1
|
|
1120
|
use if $] < 5.010, 'UNIVERSAL::DOES'; |
|
|
1
|
|
|
|
|
9
|
|
|
|
1
|
|
|
|
|
7
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
BEGIN { |
|
10
|
1
|
|
|
1
|
|
41
|
no warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
44
|
|
|
11
|
1
|
|
|
1
|
|
2
|
$Die::Hard::AUTHORITY = 'cpan:TOBYINK'; |
|
12
|
1
|
|
|
|
|
629
|
$Die::Hard::VERSION = '0.002'; |
|
13
|
|
|
|
|
|
|
} |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has proxy_for => ( |
|
16
|
|
|
|
|
|
|
is => 'ro', |
|
17
|
|
|
|
|
|
|
isa => sub { |
|
18
|
|
|
|
|
|
|
Scalar::Util::blessed($_[0]) |
|
19
|
|
|
|
|
|
|
or Carp::confess("proxy_for must be a blessed object") |
|
20
|
|
|
|
|
|
|
}, |
|
21
|
|
|
|
|
|
|
required => 1, |
|
22
|
|
|
|
|
|
|
); |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
has last_error => ( |
|
25
|
|
|
|
|
|
|
is => 'ro', |
|
26
|
|
|
|
|
|
|
required => 0, |
|
27
|
|
|
|
|
|
|
writer => '_set_last_error', |
|
28
|
|
|
|
|
|
|
clearer => '_clear_last_error', |
|
29
|
|
|
|
|
|
|
); |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub BUILDARGS |
|
32
|
|
|
|
|
|
|
{ |
|
33
|
1
|
|
|
1
|
1
|
1463
|
my $class = shift; |
|
34
|
1
|
50
|
33
|
|
|
42
|
return +{ proxy_for => $_[0] } if @_ == 1 && Scalar::Util::blessed($_[0]); |
|
35
|
0
|
|
|
|
|
0
|
return $class->SUPER::BUILDARGS(@_); |
|
36
|
|
|
|
|
|
|
} |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub AUTOLOAD |
|
39
|
|
|
|
|
|
|
{ |
|
40
|
2
|
|
|
2
|
|
56
|
my ($meth) = (our $AUTOLOAD =~ /::([^:]+)$/); |
|
41
|
|
|
|
|
|
|
|
|
42
|
2
|
|
|
|
|
5
|
local $@ = undef; |
|
43
|
2
|
|
|
|
|
3
|
my $self = shift; |
|
44
|
|
|
|
|
|
|
|
|
45
|
2
|
|
|
|
|
547
|
$self->_clear_last_error; |
|
46
|
|
|
|
|
|
|
|
|
47
|
2
|
|
33
|
|
|
571
|
my $coderef = $self->proxy_for->can($meth) || $meth; |
|
48
|
|
|
|
|
|
|
|
|
49
|
2
|
50
|
|
|
|
10
|
if (wantarray) |
|
|
|
50
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
{ |
|
51
|
0
|
|
|
|
|
0
|
my @r; |
|
52
|
|
|
|
|
|
|
$self->_set_last_error($@) |
|
53
|
0
|
0
|
|
|
|
0
|
unless eval { @r = $self->proxy_for->$coderef(@_); 1 }; |
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
54
|
0
|
|
|
|
|
0
|
return @r; |
|
55
|
|
|
|
|
|
|
} |
|
56
|
|
|
|
|
|
|
elsif (defined wantarray) |
|
57
|
|
|
|
|
|
|
{ |
|
58
|
2
|
|
|
|
|
3
|
my $r; |
|
59
|
|
|
|
|
|
|
$self->_set_last_error($@) |
|
60
|
2
|
100
|
|
|
|
5
|
unless eval { $r = $self->proxy_for->$coderef(@_); 1 }; |
|
|
2
|
|
|
|
|
9
|
|
|
|
1
|
|
|
|
|
7
|
|
|
61
|
2
|
|
|
|
|
23
|
return $r; |
|
62
|
|
|
|
|
|
|
} |
|
63
|
|
|
|
|
|
|
else |
|
64
|
|
|
|
|
|
|
{ |
|
65
|
|
|
|
|
|
|
$self->_set_last_error($@) |
|
66
|
0
|
0
|
|
|
|
0
|
unless eval { $self->proxy_for->$coderef(@_); 1 }; |
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
67
|
0
|
|
|
|
|
0
|
return; |
|
68
|
|
|
|
|
|
|
} |
|
69
|
|
|
|
|
|
|
} |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub can |
|
72
|
|
|
|
|
|
|
{ |
|
73
|
21
|
|
|
21
|
1
|
35558
|
my ($self, $method) = @_; |
|
74
|
21
|
100
|
|
|
|
174
|
return $self->SUPER::can($method) unless Scalar::Util::blessed($self); |
|
75
|
|
|
|
|
|
|
|
|
76
|
7
|
|
|
|
|
33
|
my $i_can = $self->SUPER::can($method); |
|
77
|
7
|
|
|
|
|
43
|
my $he_can = $self->proxy_for->can($method); |
|
78
|
|
|
|
|
|
|
|
|
79
|
7
|
100
|
|
|
|
29
|
return $i_can if $i_can; |
|
80
|
2
|
50
|
|
0
|
|
12
|
return sub { our $AUTOLOAD = $method; goto \&AUTOLOAD } if $he_can; |
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
81
|
0
|
|
|
|
|
0
|
return; |
|
82
|
|
|
|
|
|
|
} |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub DOES |
|
85
|
|
|
|
|
|
|
{ |
|
86
|
0
|
|
|
0
|
1
|
0
|
my ($self, $role) = @_; |
|
87
|
0
|
0
|
|
|
|
0
|
return $self->SUPER::DOES($role) unless Scalar::Util::blessed($self); |
|
88
|
0
|
0
|
|
|
|
0
|
$self->SUPER::DOES($role) or $self->proxy_for->DOES($role); |
|
89
|
|
|
|
|
|
|
} |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub isa |
|
92
|
|
|
|
|
|
|
{ |
|
93
|
3
|
|
|
3
|
1
|
1738
|
my ($self, $role) = @_; |
|
94
|
3
|
50
|
|
|
|
16
|
return $self->SUPER::isa($role) unless Scalar::Util::blessed($self); |
|
95
|
3
|
100
|
|
|
|
62
|
$self->SUPER::isa($role) or $self->proxy_for->isa($role); |
|
96
|
|
|
|
|
|
|
} |
|
97
|
|
|
|
|
|
|
|
|
98
|
1
|
|
|
1
|
|
6
|
no Moo; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
19
|
|
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
1; |
|
101
|
|
|
|
|
|
|
__END__ |