line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Curio::Util; |
2
|
|
|
|
|
|
|
our $VERSION = '0.09'; |
3
|
|
|
|
|
|
|
|
4
|
11
|
|
|
11
|
|
77
|
use Carp qw(); |
|
11
|
|
|
|
|
25
|
|
|
11
|
|
|
|
|
324
|
|
5
|
|
|
|
|
|
|
|
6
|
11
|
|
|
11
|
|
55
|
use strictures 2; |
|
11
|
|
|
|
|
92
|
|
|
11
|
|
|
|
|
473
|
|
7
|
11
|
|
|
11
|
|
6997
|
use namespace::clean; |
|
11
|
|
|
|
|
65279
|
|
|
11
|
|
|
|
|
69
|
|
8
|
|
|
|
|
|
|
|
9
|
11
|
|
|
11
|
|
2508
|
use Exporter qw( import ); |
|
11
|
|
|
|
|
24
|
|
|
11
|
|
|
|
|
3163
|
|
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
|
|
|
|
|
19
|
local $Carp::Internal{'Curio::Declare'} = 1; |
20
|
10
|
|
|
|
|
23
|
local $Carp::Internal{'Curio::Factory'} = 1; |
21
|
10
|
|
|
|
|
26
|
local $Carp::Internal{'Curio::Role'} = 1; |
22
|
10
|
|
|
|
|
20
|
local $Carp::Internal{'Curio::Util'} = 1; |
23
|
|
|
|
|
|
|
|
24
|
10
|
|
|
|
|
1192
|
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
|
|
44
|
if (eval{ require Sub::Name; 1 }) { |
|
11
|
0
|
|
|
|
5044
|
|
|
11
|
|
|
|
|
5514
|
|
35
|
11
|
|
|
|
|
330
|
*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; |