line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Curio::Util; |
2
|
|
|
|
|
|
|
our $VERSION = '0.11'; |
3
|
|
|
|
|
|
|
|
4
|
11
|
|
|
11
|
|
65
|
use Carp qw(); |
|
11
|
|
|
|
|
21
|
|
|
11
|
|
|
|
|
287
|
|
5
|
|
|
|
|
|
|
|
6
|
11
|
|
|
11
|
|
50
|
use strictures 2; |
|
11
|
|
|
|
|
82
|
|
|
11
|
|
|
|
|
418
|
|
7
|
11
|
|
|
11
|
|
5936
|
use namespace::clean; |
|
11
|
|
|
|
|
57931
|
|
|
11
|
|
|
|
|
63
|
|
8
|
|
|
|
|
|
|
|
9
|
11
|
|
|
11
|
|
2125
|
use Exporter qw( import ); |
|
11
|
|
|
|
|
28
|
|
|
11
|
|
|
|
|
2518
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @EXPORT = qw( |
12
|
|
|
|
|
|
|
croak |
13
|
|
|
|
|
|
|
croakf |
14
|
|
|
|
|
|
|
subname |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub croak { |
18
|
10
|
|
|
10
|
0
|
57
|
local $Carp::Internal{'Curio'} = 1; |
19
|
10
|
|
|
|
|
17
|
local $Carp::Internal{'Curio::Declare'} = 1; |
20
|
10
|
|
|
|
|
20
|
local $Carp::Internal{'Curio::Factory'} = 1; |
21
|
10
|
|
|
|
|
17
|
local $Carp::Internal{'Curio::Role'} = 1; |
22
|
10
|
|
|
|
|
15
|
local $Carp::Internal{'Curio::Util'} = 1; |
23
|
|
|
|
|
|
|
|
24
|
10
|
|
|
|
|
1091
|
return Carp::croak( @_ ); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub croakf { |
28
|
0
|
|
|
0
|
0
|
|
my $msg = shift; |
29
|
0
|
|
|
|
|
|
$msg = sprintf( $msg, @_ ); |
30
|
0
|
|
|
|
|
|
return croak( $msg ); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
BEGIN { |
34
|
11
|
50
|
0
|
11
|
|
54
|
if (eval{ require Sub::Name; 1 }) { |
|
11
|
0
|
|
|
|
4650
|
|
|
11
|
|
|
|
|
4937
|
|
35
|
11
|
|
|
|
|
290
|
*subname = \&Sub::Name::subname; |
36
|
|
|
|
|
|
|
} |
37
|
0
|
|
|
|
|
0
|
elsif (eval{ require Sub::Util; 1 } and defined &Sub::Util::set_subname) { |
|
0
|
|
|
|
|
0
|
|
38
|
0
|
|
|
|
|
0
|
*subname = \&Sub::Util::set_subname; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
else { |
41
|
0
|
|
|
|
|
0
|
*subname = sub{ return $_[1] }; |
|
0
|
|
|
|
|
0
|
|
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |