line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MooX::ReturnModifiers; |
2
|
|
|
|
|
|
|
|
3
|
8
|
|
|
8
|
|
420281
|
use strict; |
|
8
|
|
|
|
|
61
|
|
|
8
|
|
|
|
|
173
|
|
4
|
8
|
|
|
8
|
|
31
|
use warnings; |
|
8
|
|
|
|
|
9
|
|
|
8
|
|
|
|
|
165
|
|
5
|
8
|
|
|
8
|
|
29
|
use Carp qw/croak/; |
|
8
|
|
|
|
|
12
|
|
|
8
|
|
|
|
|
426
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '1.000000'; |
8
|
|
|
|
|
|
|
|
9
|
8
|
|
|
8
|
|
39
|
use Exporter 'import'; |
|
8
|
|
|
|
|
13
|
|
|
8
|
|
|
|
|
2184
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @EXPORT = qw/return_modifiers/; |
12
|
|
|
|
|
|
|
our @EXPORT_OK = qw/return_modifiers return_has return_with return_around return_extends return_before return_after/; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub return_modifiers { |
15
|
15
|
|
|
15
|
1
|
6757
|
my %modifiers = (); |
16
|
15
|
|
100
|
|
|
49
|
$_[1] ||= [qw/has with around extends before after/]; |
17
|
15
|
|
|
|
|
20
|
for ( @{ $_[1] } ) { |
|
15
|
|
|
|
|
43
|
|
18
|
20
|
100
|
|
|
|
92
|
unless ( $modifiers{$_} = $_[0]->can($_) ) { |
19
|
1
|
|
|
|
|
165
|
croak "Can't find method <$_> in <$_[0]>"; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
14
|
100
|
|
|
|
79
|
return $_[2] ? \%modifiers : %modifiers; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
1
|
1
|
1387
|
sub return_has {return_modifiers($_[0], [qw/has/], 1)->{has}} |
26
|
|
|
|
|
|
|
|
27
|
1
|
|
|
1
|
1
|
1585
|
sub return_with {return_modifiers($_[0], [qw/with/], 1)->{with}} |
28
|
|
|
|
|
|
|
|
29
|
1
|
|
|
1
|
1
|
1197
|
sub return_after {return_modifiers($_[0], [qw/after/], 1)->{after}} |
30
|
|
|
|
|
|
|
|
31
|
1
|
|
|
1
|
1
|
1259
|
sub return_before {return_modifiers($_[0], [qw/before/], 1)->{before}} |
32
|
|
|
|
|
|
|
|
33
|
1
|
|
|
1
|
1
|
1211
|
sub return_around {return_modifiers($_[0], [qw/around/], 1)->{around}} |
34
|
|
|
|
|
|
|
|
35
|
1
|
|
|
1
|
1
|
1858
|
sub return_extends {return_modifiers($_[0], [qw/extends/], 1)->{extends}} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |