line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package PerlX::Underscore; |
2
|
|
|
|
|
|
|
#ABSTRACT: Common helper functions without having to import them |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
5
|
8
|
|
|
8
|
|
133770
|
use strict; |
|
8
|
|
|
|
|
22
|
|
|
8
|
|
|
|
|
327
|
|
6
|
8
|
|
|
8
|
|
43
|
use warnings; |
|
8
|
|
|
|
|
17
|
|
|
8
|
|
|
|
|
272
|
|
7
|
8
|
|
|
8
|
|
53
|
no warnings 'once'; |
|
8
|
|
|
|
|
14
|
|
|
8
|
|
|
|
|
298
|
|
8
|
8
|
|
|
8
|
|
7047
|
use version (); |
|
8
|
|
|
|
|
18041
|
|
|
8
|
|
|
|
|
426
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = version::qv('v0.1.0'); |
11
|
|
|
|
|
|
|
|
12
|
8
|
|
|
8
|
|
54
|
use Scalar::Util 1.36 (); |
|
8
|
|
|
|
|
233
|
|
|
8
|
|
|
|
|
182
|
|
13
|
8
|
|
|
8
|
|
42
|
use List::Util 1.35 (); |
|
8
|
|
|
|
|
177
|
|
|
8
|
|
|
|
|
155
|
|
14
|
8
|
|
|
8
|
|
7782
|
use List::MoreUtils 0.07 (); |
|
8
|
|
|
|
|
12155
|
|
|
8
|
|
|
|
|
198
|
|
15
|
8
|
|
|
8
|
|
62
|
use Carp (); |
|
8
|
|
|
|
|
15
|
|
|
8
|
|
|
|
|
159
|
|
16
|
8
|
|
|
8
|
|
7132
|
use Safe::Isa 1.000000 (); |
|
8
|
|
|
|
|
4286
|
|
|
8
|
|
|
|
|
401
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
BEGIN { |
20
|
|
|
|
|
|
|
# check if a competing "_" exists |
21
|
8
|
100
|
|
8
|
|
567
|
if (keys %{_::}) { |
22
|
1
|
|
|
|
|
24
|
Carp::confess qq(The package "_" has already been defined); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
BEGIN { |
27
|
|
|
|
|
|
|
# prevent other "_" packages from being loaded: |
28
|
|
|
|
|
|
|
# Just setting the ${INC} entry would fail too silently, |
29
|
|
|
|
|
|
|
# so we also rigged the "import" method. |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
$INC{'_.pm'} = *_::import = sub { |
32
|
0
|
|
|
0
|
|
|
Carp::confess qq(The "_" package is internal to PerlX::Underscore) |
33
|
|
|
|
|
|
|
. qq(and must not be imported directly.\n); |
34
|
7
|
|
|
7
|
|
4318
|
}; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
*_::class = \&Scalar::Util::blessed; |
40
|
|
|
|
|
|
|
*_::blessed = \&Scalar::Util::blessed; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
*_::ref_addr = \&Scalar::Util::refaddr; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
*_::ref_type = \&Scalar::Util::reftype; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
*_::ref_weaken = \&Scalar::Util::weaken; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
*_::ref_unweaken = \&Scalar::Util::unweaken; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
*_::ref_is_weak = \&Scalar::Util::isweak; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
*_::reduce = \&List::Util::reduce; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
*_::any = \&List::Util::any; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
*_::all = \&List::Util::all; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
*_::none = \&List::Util::none; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
*_::first = \&List::MoreUtils::first_value; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
*_::first_index = \&List::MoreUtils::first_index; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
*_::last = \&List::MoreUtils::last_value; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
*_::last_index = \&List::MoreUtils::last_index; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
*_::max = \&List::Util::max; |
70
|
|
|
|
|
|
|
*_::max_str = \&List::Util::maxstr; |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
*_::min = \&List::Util::min; |
73
|
|
|
|
|
|
|
*_::min_str = \&List::Util::minstr; |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
*_::sum = \&List::Util::sum; |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
*_::product = \&List::Util::product; |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
*_::pairgrep = \&List::Util::pairgrep; |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
*_::pairfirst = \&List::Util::pairfirst; |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
*_::pairmap = \&List::Util::pairmap; |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
*_::shuffle = \&List::Util::shuffle; |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
*_::natatime = \&List::MoreUtils::natatime; |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
*_::zip = \&List::MoreUtils::zip; |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
*_::uniq = \&List::MoreUtils::uniq; |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
*_::part = \&List::MoreUtils::part; |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
*_::carp = \&Carp::carp; |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
*_::cluck = \&Carp::cluck; |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
*_::croak = \&Carp::croak; |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
*_::confess = \&Carp::confess; |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
*_::isa = $Safe::Isa::_isa; |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
*_::does = $Safe::Isa::_DOES; |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
*_::can = $Safe::Isa::_can; |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
*_::safecall = $Safe::Isa::_call_if_object; |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
1; |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
__END__ |