line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Util; |
2
|
|
|
|
|
|
|
|
3
|
45
|
|
|
45
|
|
625074
|
use 5.008_001; |
|
45
|
|
|
|
|
115
|
|
4
|
45
|
|
|
45
|
|
159
|
use strict; |
|
45
|
|
|
|
|
48
|
|
|
45
|
|
|
|
|
1279
|
|
5
|
|
|
|
|
|
|
#use warnings; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.64'; |
8
|
|
|
|
|
|
|
|
9
|
45
|
|
|
45
|
|
151
|
use Exporter; |
|
45
|
|
|
|
|
53
|
|
|
45
|
|
|
|
|
8032
|
|
10
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $TESTING_PERL_ONLY; |
13
|
|
|
|
|
|
|
$TESTING_PERL_ONLY = $ENV{DATA_UTIL_PUREPERL} ? 1 : 0 |
14
|
|
|
|
|
|
|
unless defined $TESTING_PERL_ONLY; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
unless($TESTING_PERL_ONLY){ |
17
|
|
|
|
|
|
|
local $@; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
$TESTING_PERL_ONLY = !eval{ |
20
|
|
|
|
|
|
|
require XSLoader; |
21
|
|
|
|
|
|
|
XSLoader::load(__PACKAGE__, $VERSION); |
22
|
|
|
|
|
|
|
}; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# if($@ && $ENV{DATA_UTIL_DEBUG}){ |
25
|
|
|
|
|
|
|
# warn $@; |
26
|
|
|
|
|
|
|
# } |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
require 'Data/Util/PurePerl.pm' # not to create the namespace |
29
|
|
|
|
|
|
|
if $TESTING_PERL_ONLY; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
our @EXPORT_OK = qw( |
32
|
|
|
|
|
|
|
is_scalar_ref is_array_ref is_hash_ref is_code_ref is_glob_ref is_rx is_regex_ref |
33
|
|
|
|
|
|
|
is_instance is_invocant |
34
|
|
|
|
|
|
|
is_value is_string is_number is_integer |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
scalar_ref array_ref hash_ref code_ref glob_ref rx regex_ref |
37
|
|
|
|
|
|
|
instance invocant |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
anon_scalar neat |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
get_stash |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
install_subroutine |
44
|
|
|
|
|
|
|
uninstall_subroutine |
45
|
|
|
|
|
|
|
get_code_info |
46
|
|
|
|
|
|
|
get_code_ref |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
curry |
49
|
|
|
|
|
|
|
modify_subroutine |
50
|
|
|
|
|
|
|
subroutine_modifier |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
mkopt |
53
|
|
|
|
|
|
|
mkopt_hash |
54
|
|
|
|
|
|
|
); |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( |
57
|
|
|
|
|
|
|
all => \@EXPORT_OK, |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
check => [qw( |
60
|
|
|
|
|
|
|
is_scalar_ref is_array_ref is_hash_ref is_code_ref |
61
|
|
|
|
|
|
|
is_glob_ref is_rx is_instance is_invocant |
62
|
|
|
|
|
|
|
is_value is_string is_number is_integer |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
is_regex_ref |
65
|
|
|
|
|
|
|
)], |
66
|
|
|
|
|
|
|
validate => [qw( |
67
|
|
|
|
|
|
|
scalar_ref array_ref hash_ref code_ref |
68
|
|
|
|
|
|
|
glob_ref rx instance invocant |
69
|
|
|
|
|
|
|
regex_ref |
70
|
|
|
|
|
|
|
)], |
71
|
|
|
|
|
|
|
); |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
1; |
74
|
|
|
|
|
|
|
__END__ |