line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
3
|
|
|
3
|
|
65118
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
106
|
|
2
|
3
|
|
|
3
|
|
18
|
use warnings; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
223
|
|
3
|
|
|
|
|
|
|
package Object::Capsule; |
4
|
|
|
|
|
|
|
{ |
5
|
|
|
|
|
|
|
$Object::Capsule::VERSION = '0.012'; |
6
|
|
|
|
|
|
|
} |
7
|
|
|
|
|
|
|
# ABSTRACT: wrap any object in a flavorless capsule (don't use this) |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub import { |
11
|
3
|
|
|
3
|
|
30
|
my ($importer) = caller; |
12
|
|
|
|
|
|
|
## no critic (ProhibitNoStrict) |
13
|
3
|
|
|
3
|
|
14
|
no strict 'refs'; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
6047
|
|
14
|
3
|
|
|
|
|
42
|
*{$importer."\::encapsulate"} = sub { |
15
|
2
|
|
|
2
|
|
31
|
my $object = shift; |
16
|
2
|
|
|
|
|
13
|
bless \$object => __PACKAGE__; |
17
|
|
|
|
|
|
|
} |
18
|
3
|
|
|
|
|
12
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub AUTOLOAD { ## no critic Autoload |
21
|
8
|
|
|
8
|
|
3508
|
my $self = shift; |
22
|
8
|
|
|
|
|
15
|
my $method = our $AUTOLOAD; |
23
|
8
|
|
|
|
|
50
|
$method =~ s/.*:://; |
24
|
|
|
|
|
|
|
|
25
|
8
|
100
|
|
|
|
28
|
unless (ref $self) { |
26
|
1
|
|
|
|
|
6
|
my($callpack, $callfile, $callline) = caller; |
27
|
1
|
|
|
|
|
17
|
die sprintf ## no critic RequireCarping |
28
|
|
|
|
|
|
|
qq{Can\'t locate object method "%s" via package "%s" }. |
29
|
|
|
|
|
|
|
qq{at %s line %d.\n}, |
30
|
|
|
|
|
|
|
$method, $self, $callfile, $callline; |
31
|
|
|
|
|
|
|
} |
32
|
7
|
50
|
|
|
|
11
|
return unless eval { $$self->can($method); }; |
|
7
|
|
|
|
|
16
|
|
33
|
7
|
|
|
|
|
13
|
$$self->$method(@_); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
# ++ -- |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
use overload |
41
|
20
|
|
|
20
|
|
1398
|
'${}' => sub { $_[0] }, |
42
|
0
|
|
|
0
|
|
0
|
'@{}' => sub { @{$_[0]} }, |
|
0
|
|
|
|
|
0
|
|
43
|
0
|
|
|
0
|
|
0
|
'%{}' => sub { %{$_[0]} }, |
|
0
|
|
|
|
|
0
|
|
44
|
0
|
|
|
0
|
|
0
|
'*{}' => sub { *{$_[0]} }, |
|
0
|
|
|
|
|
0
|
|
45
|
1
|
|
|
1
|
|
397
|
'""' => sub { "${$_[0]}" }, |
|
1
|
|
|
|
|
4
|
|
46
|
0
|
|
|
0
|
|
0
|
'0+' => sub { 0 + ${$_[0]} }, |
|
0
|
|
|
|
|
0
|
|
47
|
0
|
|
|
0
|
|
0
|
'bool' => sub { ${$_[0]} }, |
|
0
|
|
|
|
|
0
|
|
48
|
0
|
0
|
|
0
|
|
0
|
'+' => sub { $_[2] ? ($_[1] + ${$_[0]}) : (${$_[0]} + $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
49
|
0
|
0
|
|
0
|
|
0
|
'+=' => sub { $_[2] ? ($_[1] += ${$_[0]}) : (${$_[0]} += $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
50
|
0
|
0
|
|
0
|
|
0
|
'-' => sub { $_[2] ? ($_[1] - ${$_[0]}) : (${$_[0]} - $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
51
|
0
|
0
|
|
0
|
|
0
|
'-=' => sub { $_[2] ? ($_[1] -= ${$_[0]}) : (${$_[0]} -= $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
52
|
0
|
0
|
|
0
|
|
0
|
'*' => sub { $_[2] ? ($_[1] * ${$_[0]}) : (${$_[0]} * $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
53
|
0
|
0
|
|
0
|
|
0
|
'*=' => sub { $_[2] ? ($_[1] *= ${$_[0]}) : (${$_[0]} *= $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
54
|
0
|
0
|
|
0
|
|
0
|
'/' => sub { $_[2] ? ($_[1] / ${$_[0]}) : (${$_[0]} / $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
55
|
0
|
0
|
|
0
|
|
0
|
'/=' => sub { $_[2] ? ($_[1] /= ${$_[0]}) : (${$_[0]} /= $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
56
|
0
|
0
|
|
0
|
|
0
|
'%' => sub { $_[2] ? ($_[1] % ${$_[0]}) : (${$_[0]} % $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
57
|
0
|
0
|
|
0
|
|
0
|
'%=' => sub { $_[2] ? ($_[1] %= ${$_[0]}) : (${$_[0]} %= $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
58
|
0
|
0
|
|
0
|
|
0
|
'**' => sub { $_[2] ? ($_[1] ** ${$_[0]}) : (${$_[0]} ** $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
59
|
0
|
0
|
|
0
|
|
0
|
'**=' => sub { $_[2] ? ($_[1] **= ${$_[0]}) : (${$_[0]} **= $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
60
|
0
|
0
|
|
0
|
|
0
|
'<<' => sub { $_[2] ? ($_[1] << ${$_[0]}) : (${$_[0]} << $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
61
|
0
|
0
|
|
0
|
|
0
|
'<<=' => sub { $_[2] ? ($_[1] <<= ${$_[0]}) : (${$_[0]} <<= $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
62
|
0
|
0
|
|
0
|
|
0
|
'>>' => sub { $_[2] ? ($_[1] >> ${$_[0]}) : (${$_[0]} >> $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
63
|
0
|
0
|
|
0
|
|
0
|
'>>=' => sub { $_[2] ? ($_[1] >>= ${$_[0]}) : (${$_[0]} >>= $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
64
|
0
|
0
|
|
0
|
|
0
|
'x' => sub { $_[2] ? ($_[1] x ${$_[0]}) : (${$_[0]} x $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
65
|
0
|
0
|
|
0
|
|
0
|
'x=' => sub { $_[2] ? ($_[1] x= ${$_[0]}) : (${$_[0]} x= $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
66
|
0
|
0
|
|
0
|
|
0
|
'.' => sub { $_[2] ? ($_[1] . ${$_[0]}) : (${$_[0]} . $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
67
|
0
|
0
|
|
0
|
|
0
|
'.=' => sub { $_[2] ? ($_[1] .= ${$_[0]}) : (${$_[0]} .= $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
68
|
0
|
0
|
|
0
|
|
0
|
'<' => sub { $_[2] ? ($_[1] < ${$_[0]}) : (${$_[0]} < $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
69
|
0
|
0
|
|
0
|
|
0
|
'<=' => sub { $_[2] ? ($_[1] <= ${$_[0]}) : (${$_[0]} <= $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
70
|
0
|
0
|
|
0
|
|
0
|
'>' => sub { $_[2] ? ($_[1] > ${$_[0]}) : (${$_[0]} > $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
71
|
0
|
0
|
|
0
|
|
0
|
'>=' => sub { $_[2] ? ($_[1] >= ${$_[0]}) : (${$_[0]} >= $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
72
|
1
|
50
|
|
1
|
|
1789
|
'==' => sub { $_[2] ? ($_[1] == ${$_[0]}) : (${$_[0]} == $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
5
|
|
73
|
0
|
0
|
|
0
|
|
0
|
'!=' => sub { $_[2] ? ($_[1] != ${$_[0]}) : (${$_[0]} != $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
74
|
0
|
0
|
|
0
|
|
0
|
'<=>' => sub { $_[2] ? ($_[1] <=> ${$_[0]}) : (${$_[0]} <=> $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
75
|
0
|
0
|
|
0
|
|
0
|
'lt' => sub { $_[2] ? ($_[1] lt ${$_[0]}) : (${$_[0]} lt $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
76
|
0
|
0
|
|
0
|
|
0
|
'le' => sub { $_[2] ? ($_[1] le ${$_[0]}) : (${$_[0]} le $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
77
|
0
|
0
|
|
0
|
|
0
|
'gt' => sub { $_[2] ? ($_[1] gt ${$_[0]}) : (${$_[0]} gt $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
78
|
0
|
0
|
|
0
|
|
0
|
'ge' => sub { $_[2] ? ($_[1] ge ${$_[0]}) : (${$_[0]} ge $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
79
|
2
|
50
|
|
2
|
|
1042
|
'eq' => sub { $_[2] ? ($_[1] eq ${$_[0]}) : (${$_[0]} eq $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
2
|
|
|
|
|
5
|
|
80
|
0
|
0
|
|
0
|
|
0
|
'ne' => sub { $_[2] ? ($_[1] ne ${$_[0]}) : (${$_[0]} ne $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
81
|
0
|
0
|
|
0
|
|
0
|
'cmp' => sub { $_[2] ? ($_[1] cmp ${$_[0]}) : (${$_[0]} cmp $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
82
|
0
|
0
|
|
0
|
|
0
|
'&' => sub { $_[2] ? ($_[1] & ${$_[0]}) : (${$_[0]} & $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
83
|
0
|
0
|
|
0
|
|
0
|
'^' => sub { $_[2] ? ($_[1] ^ ${$_[0]}) : (${$_[0]} ^ $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
84
|
0
|
0
|
|
0
|
|
0
|
'|' => sub { $_[2] ? ($_[1] | ${$_[0]}) : (${$_[0]} | $_[1]); }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
85
|
0
|
|
|
0
|
|
0
|
'!' => sub { !(${$_[0]}) }, |
|
0
|
|
|
|
|
0
|
|
86
|
0
|
|
|
0
|
|
0
|
'~' => sub { ~(${$_[0]}) }, |
|
0
|
|
|
|
|
0
|
|
87
|
0
|
|
|
0
|
|
0
|
'neg' => sub { neg(${$_[0]}) }, |
|
0
|
|
|
|
|
0
|
|
88
|
0
|
|
|
0
|
|
0
|
'cos' => sub { cos(${$_[0]}) }, |
|
0
|
|
|
|
|
0
|
|
89
|
0
|
|
|
0
|
|
0
|
'sin' => sub { sin(${$_[0]}) }, |
|
0
|
|
|
|
|
0
|
|
90
|
0
|
|
|
0
|
|
0
|
'exp' => sub { exp(${$_[0]}) }, |
|
0
|
|
|
|
|
0
|
|
91
|
0
|
|
|
0
|
|
0
|
'abs' => sub { abs(${$_[0]}) }, |
|
0
|
|
|
|
|
0
|
|
92
|
0
|
|
|
0
|
|
0
|
'log' => sub { log(${$_[0]}) }, |
|
0
|
|
|
|
|
0
|
|
93
|
0
|
|
|
0
|
|
0
|
'int' => sub { int(${$_[0]}) }, |
|
0
|
|
|
|
|
0
|
|
94
|
0
|
0
|
|
0
|
|
0
|
'atan2' => sub { $_[2] ? atan2($_[1],${$_[0]}) : atan2(${$_[0]},$_[1]) }, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
95
|
0
|
|
|
0
|
|
0
|
'sqrt' => sub { sqrt(${$_[0]}) }, |
|
0
|
|
|
|
|
0
|
|
96
|
0
|
|
|
0
|
|
0
|
'<>' => sub { <${$_[0]}> }, |
|
0
|
|
|
|
|
0
|
|
97
|
3
|
|
|
3
|
|
5084
|
; |
|
3
|
|
|
|
|
3275
|
|
|
3
|
|
|
|
|
247
|
|
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
1; |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
__END__ |