line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Capture::Attribute::Return; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
85
|
use 5.010; |
|
2
|
|
|
|
|
18
|
|
|
2
|
|
|
|
|
96
|
|
4
|
2
|
|
|
2
|
|
13
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
109
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
BEGIN { |
7
|
2
|
|
|
2
|
|
4
|
$Capture::Attribute::Return::AUTHORITY = 'cpan:TOBYINK'; |
8
|
2
|
|
|
|
|
34
|
$Capture::Attribute::Return::VERSION = '0.003'; |
9
|
|
|
|
|
|
|
} |
10
|
|
|
|
|
|
|
|
11
|
2
|
|
|
2
|
|
2110
|
use Any::Moose; |
|
2
|
|
|
|
|
182204
|
|
|
2
|
|
|
|
|
15
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
use overload |
14
|
2
|
|
|
|
|
20
|
'@{}' => '_ARRAY', |
15
|
|
|
|
|
|
|
'""' => '_SCALAR', |
16
|
2
|
|
|
2
|
|
14924
|
'${}' => '_SCALAR'; |
|
2
|
|
|
|
|
2579
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
has wasarray => ( |
19
|
|
|
|
|
|
|
is => 'ro', |
20
|
|
|
|
|
|
|
isa => 'Num|Undef', |
21
|
|
|
|
|
|
|
required => 1, |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
has value => ( |
25
|
|
|
|
|
|
|
is => 'ro', |
26
|
|
|
|
|
|
|
required => 0, |
27
|
|
|
|
|
|
|
predicate => 'has_value', |
28
|
|
|
|
|
|
|
); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub _ARRAY |
31
|
|
|
|
|
|
|
{ |
32
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
33
|
0
|
0
|
|
|
|
0
|
return [] if $self->is_void; |
34
|
0
|
0
|
|
|
|
0
|
return $self->wasarray ? $self->value : [ $self->value ]; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub _SCALAR |
38
|
|
|
|
|
|
|
{ |
39
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
40
|
0
|
0
|
|
|
|
0
|
return undef if $self->is_void; |
41
|
0
|
0
|
|
|
|
0
|
$self->wasarray ? do { my @a = @{$self->value}; scalar(@a) } : $self->value; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub is_list |
45
|
|
|
|
|
|
|
{ |
46
|
1
|
|
|
1
|
1
|
3
|
my ($self) = @_; |
47
|
1
|
50
|
|
|
|
16
|
return 1 if $self->wasarray; |
48
|
0
|
|
|
|
|
0
|
return; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub is_scalar |
52
|
|
|
|
|
|
|
{ |
53
|
1
|
|
|
1
|
1
|
3
|
my ($self) = @_; |
54
|
1
|
|
|
|
|
7
|
my $wasarray = $self->wasarray; |
55
|
1
|
50
|
|
|
|
8
|
return if $wasarray; |
56
|
1
|
50
|
|
|
|
10
|
return 1 if defined $wasarray; |
57
|
0
|
|
|
|
|
|
return; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub is_void |
61
|
|
|
|
|
|
|
{ |
62
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
63
|
0
|
0
|
|
|
|
|
return if defined $self->wasarray; |
64
|
0
|
|
|
|
|
|
return 1; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
__PACKAGE__ |
68
|
|
|
|
|
|
|
__END__ |