line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Curio::Util; |
2
|
|
|
|
|
|
|
our $VERSION = '0.10'; |
3
|
|
|
|
|
|
|
|
4
|
11
|
|
|
11
|
|
84
|
use Carp qw(); |
|
11
|
|
|
|
|
21
|
|
|
11
|
|
|
|
|
337
|
|
5
|
|
|
|
|
|
|
|
6
|
11
|
|
|
11
|
|
53
|
use strictures 2; |
|
11
|
|
|
|
|
103
|
|
|
11
|
|
|
|
|
494
|
|
7
|
11
|
|
|
11
|
|
6999
|
use namespace::clean; |
|
11
|
|
|
|
|
65821
|
|
|
11
|
|
|
|
|
68
|
|
8
|
|
|
|
|
|
|
|
9
|
11
|
|
|
11
|
|
2469
|
use Exporter qw( import ); |
|
11
|
|
|
|
|
25
|
|
|
11
|
|
|
|
|
2850
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @EXPORT = qw( |
12
|
|
|
|
|
|
|
croak |
13
|
|
|
|
|
|
|
croakf |
14
|
|
|
|
|
|
|
subname |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub croak { |
18
|
10
|
|
|
10
|
0
|
73
|
local $Carp::Internal{'Curio'} = 1; |
19
|
10
|
|
|
|
|
22
|
local $Carp::Internal{'Curio::Declare'} = 1; |
20
|
10
|
|
|
|
|
17
|
local $Carp::Internal{'Curio::Factory'} = 1; |
21
|
10
|
|
|
|
|
19
|
local $Carp::Internal{'Curio::Role'} = 1; |
22
|
10
|
|
|
|
|
17
|
local $Carp::Internal{'Curio::Util'} = 1; |
23
|
|
|
|
|
|
|
|
24
|
10
|
|
|
|
|
1221
|
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
|
|
101
|
if (eval{ require Sub::Name; 1 }) { |
|
11
|
0
|
|
|
|
5100
|
|
|
11
|
|
|
|
|
5673
|
|
35
|
11
|
|
|
|
|
338
|
*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; |