line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
222649
|
use 5.014; |
|
1
|
|
|
|
|
12
|
|
2
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
19
|
|
3
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
415
|
use results (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
100
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
package results::wrap; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
10
|
|
|
|
|
|
|
our $VERSION = '0.006'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
BEGIN { |
13
|
1
|
50
|
|
1
|
|
5
|
if ( $] ge '5.034' ) { |
14
|
0
|
|
|
|
|
0
|
require experimental; |
15
|
0
|
|
|
|
|
0
|
'experimental'->import( 'try' ); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
else { |
18
|
1
|
|
|
|
|
511
|
require Syntax::Keyword::Try; |
19
|
1
|
|
|
|
|
2188
|
'Syntax::Keyword::Try'->import; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
}; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub AUTOLOAD { |
24
|
2
|
|
|
2
|
|
6284
|
my ( $invocant, @args ) = @_; |
25
|
2
|
|
|
|
|
21
|
my ( $method ) = ( our $AUTOLOAD =~ /::(\w+)$/ ); |
26
|
|
|
|
|
|
|
try { |
27
|
|
|
|
|
|
|
return results::ok( $invocant->$method( @args ) ); |
28
|
|
|
|
|
|
|
} |
29
|
2
|
|
|
|
|
7
|
catch ( $e ) { |
30
|
|
|
|
|
|
|
return results::err( $e ); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub results::wrap (&) { |
35
|
4
|
100
|
66
|
4
|
0
|
76505
|
if ( @_ == 1 and ref($_[0]) eq 'CODE' ) { |
36
|
2
|
|
|
|
|
5
|
my ( $code ) = @_; |
37
|
|
|
|
|
|
|
try { |
38
|
|
|
|
|
|
|
return results::ok( $code->() ); |
39
|
|
|
|
|
|
|
} |
40
|
2
|
|
|
|
|
5
|
catch ( $e ) { |
41
|
|
|
|
|
|
|
return results::err( $e ); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
else { |
45
|
2
|
|
|
|
|
7
|
my ( $invocant, $method, @args ) = @_; |
46
|
|
|
|
|
|
|
try { |
47
|
|
|
|
|
|
|
return results::ok( $invocant->$method( @args ) ); |
48
|
|
|
|
|
|
|
} |
49
|
2
|
|
|
|
|
6
|
catch ( $e ) { |
50
|
|
|
|
|
|
|
return results::err( $e ); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
__END__ |