line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
{ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
use strict; |
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
5
|
1
|
|
|
1
|
|
5
|
no warnings qw( once void ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
6
|
1
|
|
|
1
|
|
4
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
120
|
|
7
|
|
|
|
|
|
|
our $USES_MITE = "Mite::Class"; |
8
|
|
|
|
|
|
|
our $MITE_SHIM = "Mite::Shim"; |
9
|
|
|
|
|
|
|
our $MITE_VERSION = "0.011000"; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# Mite keywords |
12
|
|
|
|
|
|
|
BEGIN { |
13
|
|
|
|
|
|
|
my ( $SHIM, $CALLER ) = ( "Mite::Shim", "Mite::MakeMaker" ); |
14
|
1
|
|
|
1
|
|
4
|
( |
15
|
|
|
|
|
|
|
*after, *around, *before, *extends, *field, |
16
|
|
|
|
|
|
|
*has, *param, *signature_for, *with |
17
|
|
|
|
|
|
|
) |
18
|
|
|
|
|
|
|
= do { |
19
|
1
|
|
|
|
|
2
|
|
20
|
|
|
|
|
|
|
no warnings 'redefine'; |
21
|
|
|
|
|
|
|
( |
22
|
1
|
|
|
1
|
|
5
|
sub { $SHIM->HANDLE_after( $CALLER, "class", @_ ) }, |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
158
|
|
23
|
|
|
|
|
|
|
sub { $SHIM->HANDLE_around( $CALLER, "class", @_ ) }, |
24
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_before( $CALLER, "class", @_ ) }, |
25
|
0
|
|
|
0
|
|
0
|
sub { }, |
26
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_has( $CALLER, field => @_ ) }, |
27
|
|
|
|
0
|
|
|
sub { $SHIM->HANDLE_has( $CALLER, has => @_ ) }, |
28
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_has( $CALLER, param => @_ ) }, |
29
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_signature_for( $CALLER, "class", @_ ) }, |
30
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_with( $CALLER, @_ ) }, |
31
|
2
|
|
|
2
|
|
18
|
); |
32
|
0
|
|
|
0
|
|
0
|
} |
33
|
1
|
|
|
|
|
116
|
|
34
|
|
|
|
|
|
|
# Mite imports |
35
|
|
|
|
|
|
|
BEGIN { |
36
|
|
|
|
|
|
|
require Scalar::Util; |
37
|
|
|
|
|
|
|
*STRICT = \&Mite::Shim::STRICT; |
38
|
|
|
|
|
|
|
*bare = \&Mite::Shim::bare; |
39
|
1
|
|
|
1
|
|
7
|
*blessed = \&Scalar::Util::blessed; |
40
|
1
|
|
|
|
|
3
|
*carp = \&Mite::Shim::carp; |
41
|
1
|
|
|
|
|
2
|
*confess = \&Mite::Shim::confess; |
42
|
1
|
|
|
|
|
2
|
*croak = \&Mite::Shim::croak; |
43
|
1
|
|
|
|
|
3
|
*false = \&Mite::Shim::false; |
44
|
1
|
|
|
|
|
2
|
*guard = \&Mite::Shim::guard; |
45
|
1
|
|
|
|
|
2
|
*lazy = \&Mite::Shim::lazy; |
46
|
1
|
|
|
|
|
2
|
*lock = \&Mite::Shim::lock; |
47
|
1
|
|
|
|
|
2
|
*ro = \&Mite::Shim::ro; |
48
|
1
|
|
|
|
|
2
|
*rw = \&Mite::Shim::rw; |
49
|
1
|
|
|
|
|
1
|
*rwp = \&Mite::Shim::rwp; |
50
|
1
|
|
|
|
|
2
|
*true = \&Mite::Shim::true; |
51
|
1
|
|
|
|
|
1
|
*unlock = \&Mite::Shim::unlock; |
52
|
1
|
|
|
|
|
2
|
} |
53
|
1
|
|
|
|
|
2
|
|
54
|
1
|
|
|
|
|
22
|
# Gather metadata for constructor and destructor |
55
|
|
|
|
|
|
|
no strict 'refs'; |
56
|
|
|
|
|
|
|
my $class = shift; |
57
|
|
|
|
|
|
|
$class = ref($class) || $class; |
58
|
|
|
|
|
|
|
my $linear_isa = mro::get_linear_isa($class); |
59
|
1
|
|
|
1
|
|
4
|
return { |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
439
|
|
60
|
0
|
|
|
0
|
|
|
BUILD => [ |
61
|
0
|
|
0
|
|
|
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
62
|
0
|
|
|
|
|
|
map { "$_\::BUILD" } reverse @$linear_isa |
63
|
|
|
|
|
|
|
], |
64
|
|
|
|
|
|
|
DEMOLISH => [ |
65
|
0
|
0
|
|
|
|
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
66
|
0
|
|
|
|
|
|
map { "$_\::DEMOLISH" } @$linear_isa |
67
|
|
|
|
|
|
|
], |
68
|
|
|
|
|
|
|
HAS_BUILDARGS => $class->can('BUILDARGS'), |
69
|
0
|
0
|
|
|
|
|
HAS_FOREIGNBUILDARGS => $class->can('FOREIGNBUILDARGS'), |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
70
|
0
|
|
|
|
|
|
}; |
|
0
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
# Standard Moose/Moo-style constructor |
74
|
|
|
|
|
|
|
my $class = ref( $_[0] ) ? ref(shift) : shift; |
75
|
|
|
|
|
|
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
76
|
|
|
|
|
|
|
my $self = bless {}, $class; |
77
|
|
|
|
|
|
|
my $args = |
78
|
|
|
|
|
|
|
$meta->{HAS_BUILDARGS} |
79
|
0
|
0
|
|
0
|
0
|
|
? $class->BUILDARGS(@_) |
80
|
0
|
|
0
|
|
|
|
: { ( @_ == 1 ) ? %{ $_[0] } : @_ }; |
81
|
0
|
|
|
|
|
|
my $no_build = delete $args->{__no_BUILD__}; |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
# Call BUILD methods |
84
|
|
|
|
|
|
|
$self->BUILDALL($args) if ( !$no_build and @{ $meta->{BUILD} || [] } ); |
85
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
86
|
0
|
|
|
|
|
|
# Unrecognized parameters |
87
|
|
|
|
|
|
|
my @unknown = grep not( |
88
|
|
|
|
|
|
|
do { |
89
|
0
|
0
|
0
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
90
|
|
|
|
|
|
|
defined($_) and do { |
91
|
|
|
|
|
|
|
ref( \$_ ) eq 'SCALAR' |
92
|
|
|
|
|
|
|
or ref( \( my $val = $_ ) ) eq 'SCALAR'; |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
), |
95
|
|
|
|
|
|
|
keys %{$args}; |
96
|
0
|
0
|
|
|
|
|
@unknown |
97
|
0
|
0
|
|
|
|
|
and croak( |
98
|
|
|
|
|
|
|
"Unexpected keys in constructor: " . join( q[, ], sort @unknown ) ); |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
return $self; |
101
|
|
|
|
|
|
|
} |
102
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
# Used by constructor to call BUILD methods |
104
|
0
|
0
|
|
|
|
|
my $class = ref( $_[0] ); |
105
|
|
|
|
|
|
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
106
|
|
|
|
|
|
|
$_->(@_) for @{ $meta->{BUILD} || [] }; |
107
|
0
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
# Destructor should call DEMOLISH methods |
110
|
|
|
|
|
|
|
my $self = shift; |
111
|
|
|
|
|
|
|
my $class = ref($self) || $self; |
112
|
0
|
|
|
0
|
0
|
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
113
|
0
|
|
0
|
|
|
|
my $in_global_destruction = |
114
|
0
|
0
|
|
|
|
|
defined ${^GLOBAL_PHASE} |
|
0
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
? ${^GLOBAL_PHASE} eq 'DESTRUCT' |
116
|
|
|
|
|
|
|
: Devel::GlobalDestruction::in_global_destruction(); |
117
|
|
|
|
|
|
|
for my $demolisher ( @{ $meta->{DEMOLISH} || [] } ) { |
118
|
|
|
|
|
|
|
my $e = do { |
119
|
0
|
|
|
0
|
|
|
local ( $?, $@ ); |
120
|
0
|
|
0
|
|
|
|
eval { $demolisher->( $self, $in_global_destruction ) }; |
121
|
0
|
|
0
|
|
|
|
$@; |
122
|
0
|
0
|
|
|
|
|
}; |
123
|
|
|
|
|
|
|
no warnings 'misc'; # avoid (in cleanup) warnings |
124
|
|
|
|
|
|
|
die $e if $e; # rethrow |
125
|
|
|
|
|
|
|
} |
126
|
0
|
0
|
|
|
|
|
return; |
|
0
|
|
|
|
|
|
|
127
|
0
|
|
|
|
|
|
} |
128
|
0
|
|
|
|
|
|
|
129
|
0
|
|
|
|
|
|
# See UNIVERSAL |
|
0
|
|
|
|
|
|
|
130
|
0
|
|
|
|
|
|
my ( $self, $role ) = @_; |
131
|
|
|
|
|
|
|
our %DOES; |
132
|
1
|
|
|
1
|
|
6
|
return $DOES{$role} if exists $DOES{$role}; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
277
|
|
133
|
0
|
0
|
|
|
|
|
return 1 if $role eq __PACKAGE__; |
134
|
|
|
|
|
|
|
if ( $INC{'Moose/Util.pm'} |
135
|
0
|
|
|
|
|
|
and my $meta = Moose::Util::find_meta( ref $self or $self ) ) |
136
|
|
|
|
|
|
|
{ |
137
|
|
|
|
|
|
|
$meta->can('does_role') and $meta->does_role($role) and return 1; |
138
|
|
|
|
|
|
|
} |
139
|
|
|
|
|
|
|
return $self->SUPER::DOES($role); |
140
|
0
|
|
|
0
|
0
|
|
} |
141
|
0
|
|
|
|
|
|
|
142
|
0
|
0
|
|
|
|
|
# Alias for Moose/Moo-compatibility |
143
|
0
|
0
|
|
|
|
|
shift->DOES(@_); |
144
|
0
|
0
|
0
|
|
|
|
} |
|
|
|
0
|
|
|
|
|
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
# Method signatures |
147
|
0
|
0
|
0
|
|
|
|
our %SIGNATURE_FOR; |
148
|
|
|
|
|
|
|
|
149
|
0
|
|
|
|
|
|
$SIGNATURE_FOR{"change_parent_dir"} = sub { |
150
|
|
|
|
|
|
|
my $__NEXT__ = shift; |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
my ( @out, %tmp, $tmp, $dtmp, @head ); |
153
|
|
|
|
|
|
|
|
154
|
0
|
|
|
0
|
0
|
|
@_ == 3 |
155
|
|
|
|
|
|
|
or |
156
|
|
|
|
|
|
|
croak( "Wrong number of parameters in signature for %s: got %d, %s", |
157
|
|
|
|
|
|
|
"change_parent_dir", scalar(@_), "expected exactly 3 parameters" ); |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
@head = splice( @_, 0, 0 ); |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
# Parameter $_[0] (type: Path) |
162
|
|
|
|
|
|
|
$tmp = ( |
163
|
|
|
|
|
|
|
( |
164
|
|
|
|
|
|
|
do { |
165
|
|
|
|
|
|
|
use Scalar::Util (); |
166
|
|
|
|
|
|
|
Scalar::Util::blessed( $_[0] ) |
167
|
|
|
|
|
|
|
and $_[0]->isa(q[Path::Tiny]); |
168
|
|
|
|
|
|
|
} |
169
|
|
|
|
|
|
|
) |
170
|
|
|
|
|
|
|
) ? $_[0] : ( |
171
|
|
|
|
|
|
|
do { |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
defined( $_[0] ) and do { |
174
|
|
|
|
|
|
|
ref( \$_[0] ) eq 'SCALAR' |
175
|
|
|
|
|
|
|
or ref( \( my $val = $_[0] ) ) eq 'SCALAR'; |
176
|
1
|
|
|
1
|
|
6
|
} |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
233
|
|
177
|
|
|
|
|
|
|
) |
178
|
|
|
|
|
|
|
? scalar( |
179
|
|
|
|
|
|
|
do { local $_ = $_[0]; Path::Tiny::path($_) } |
180
|
|
|
|
|
|
|
) |
181
|
|
|
|
|
|
|
: ( |
182
|
|
|
|
|
|
|
do { |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
defined( $_[0] ) && !ref( $_[0] ) |
185
|
|
|
|
|
|
|
or Scalar::Util::blessed( $_[0] ) && ( |
186
|
|
|
|
|
|
|
sub { |
187
|
|
|
|
|
|
|
require overload; |
188
|
|
|
|
|
|
|
overload::Overloaded( ref $_[0] or $_[0] ) |
189
|
|
|
|
|
|
|
and overload::Method( ( ref $_[0] or $_[0] ), $_[1] ); |
190
|
|
|
|
|
|
|
} |
191
|
|
|
|
|
|
|
)->( $_[0], q[""] ); |
192
|
|
|
|
|
|
|
) |
193
|
|
|
|
|
|
|
? scalar( |
194
|
|
|
|
|
|
|
do { local $_ = $_[0]; Path::Tiny::path($_) } |
195
|
|
|
|
|
|
|
) |
196
|
|
|
|
|
|
|
: ( ( ref( $_[0] ) eq 'ARRAY' ) ) ? scalar( |
197
|
|
|
|
|
|
|
do { local $_ = $_[0]; Path::Tiny::path(@$_) } |
198
|
|
|
|
|
|
|
) |
199
|
|
|
|
|
|
|
: $_[0]; |
200
|
|
|
|
|
|
|
( |
201
|
|
|
|
|
|
|
do { |
202
|
|
|
|
|
|
|
use Scalar::Util (); |
203
|
|
|
|
|
|
|
Scalar::Util::blessed($tmp) and $tmp->isa(q[Path::Tiny]); |
204
|
|
|
|
|
|
|
} |
205
|
|
|
|
|
|
|
) |
206
|
|
|
|
|
|
|
or croak( |
207
|
|
|
|
|
|
|
"Type check failed in signature for change_parent_dir: %s should be %s", |
208
|
|
|
|
|
|
|
"\$_[0]", "Path" |
209
|
|
|
|
|
|
|
); |
210
|
|
|
|
|
|
|
push( @out, $tmp ); |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
# Parameter $_[1] (type: Path) |
213
|
|
|
|
|
|
|
$tmp = ( |
214
|
|
|
|
|
|
|
( |
215
|
|
|
|
|
|
|
do { |
216
|
|
|
|
|
|
|
use Scalar::Util (); |
217
|
1
|
|
|
1
|
|
6
|
Scalar::Util::blessed( $_[1] ) |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
68
|
|
218
|
|
|
|
|
|
|
and $_[1]->isa(q[Path::Tiny]); |
219
|
|
|
|
|
|
|
} |
220
|
|
|
|
|
|
|
) |
221
|
|
|
|
|
|
|
) ? $_[1] : ( |
222
|
|
|
|
|
|
|
do { |
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
defined( $_[1] ) and do { |
225
|
|
|
|
|
|
|
ref( \$_[1] ) eq 'SCALAR' |
226
|
|
|
|
|
|
|
or ref( \( my $val = $_[1] ) ) eq 'SCALAR'; |
227
|
|
|
|
|
|
|
} |
228
|
|
|
|
|
|
|
) |
229
|
|
|
|
|
|
|
? scalar( |
230
|
|
|
|
|
|
|
do { local $_ = $_[1]; Path::Tiny::path($_) } |
231
|
1
|
|
|
1
|
|
6
|
) |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
191
|
|
232
|
|
|
|
|
|
|
: ( |
233
|
|
|
|
|
|
|
do { |
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
defined( $_[1] ) && !ref( $_[1] ) |
236
|
|
|
|
|
|
|
or Scalar::Util::blessed( $_[1] ) && ( |
237
|
|
|
|
|
|
|
sub { |
238
|
|
|
|
|
|
|
require overload; |
239
|
|
|
|
|
|
|
overload::Overloaded( ref $_[0] or $_[0] ) |
240
|
|
|
|
|
|
|
and overload::Method( ( ref $_[0] or $_[0] ), $_[1] ); |
241
|
|
|
|
|
|
|
} |
242
|
|
|
|
|
|
|
)->( $_[1], q[""] ); |
243
|
|
|
|
|
|
|
) |
244
|
|
|
|
|
|
|
? scalar( |
245
|
|
|
|
|
|
|
do { local $_ = $_[1]; Path::Tiny::path($_) } |
246
|
|
|
|
|
|
|
) |
247
|
|
|
|
|
|
|
: ( ( ref( $_[1] ) eq 'ARRAY' ) ) ? scalar( |
248
|
|
|
|
|
|
|
do { local $_ = $_[1]; Path::Tiny::path(@$_) } |
249
|
|
|
|
|
|
|
) |
250
|
|
|
|
|
|
|
: $_[1]; |
251
|
|
|
|
|
|
|
( |
252
|
|
|
|
|
|
|
do { |
253
|
|
|
|
|
|
|
use Scalar::Util (); |
254
|
|
|
|
|
|
|
Scalar::Util::blessed($tmp) and $tmp->isa(q[Path::Tiny]); |
255
|
|
|
|
|
|
|
} |
256
|
|
|
|
|
|
|
) |
257
|
|
|
|
|
|
|
or croak( |
258
|
|
|
|
|
|
|
"Type check failed in signature for change_parent_dir: %s should be %s", |
259
|
|
|
|
|
|
|
"\$_[1]", "Path" |
260
|
|
|
|
|
|
|
); |
261
|
|
|
|
|
|
|
push( @out, $tmp ); |
262
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
# Parameter $_[2] (type: Path) |
264
|
|
|
|
|
|
|
$tmp = ( |
265
|
|
|
|
|
|
|
( |
266
|
|
|
|
|
|
|
do { |
267
|
|
|
|
|
|
|
use Scalar::Util (); |
268
|
|
|
|
|
|
|
Scalar::Util::blessed( $_[2] ) |
269
|
|
|
|
|
|
|
and $_[2]->isa(q[Path::Tiny]); |
270
|
|
|
|
|
|
|
} |
271
|
|
|
|
|
|
|
) |
272
|
1
|
|
|
1
|
|
5
|
) ? $_[2] : ( |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
79
|
|
273
|
|
|
|
|
|
|
do { |
274
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
defined( $_[2] ) and do { |
276
|
|
|
|
|
|
|
ref( \$_[2] ) eq 'SCALAR' |
277
|
|
|
|
|
|
|
or ref( \( my $val = $_[2] ) ) eq 'SCALAR'; |
278
|
|
|
|
|
|
|
} |
279
|
|
|
|
|
|
|
) |
280
|
|
|
|
|
|
|
? scalar( |
281
|
|
|
|
|
|
|
do { local $_ = $_[2]; Path::Tiny::path($_) } |
282
|
|
|
|
|
|
|
) |
283
|
|
|
|
|
|
|
: ( |
284
|
|
|
|
|
|
|
do { |
285
|
|
|
|
|
|
|
|
286
|
1
|
|
|
1
|
|
7
|
defined( $_[2] ) && !ref( $_[2] ) |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
176
|
|
287
|
|
|
|
|
|
|
or Scalar::Util::blessed( $_[2] ) && ( |
288
|
|
|
|
|
|
|
sub { |
289
|
|
|
|
|
|
|
require overload; |
290
|
|
|
|
|
|
|
overload::Overloaded( ref $_[0] or $_[0] ) |
291
|
|
|
|
|
|
|
and overload::Method( ( ref $_[0] or $_[0] ), $_[1] ); |
292
|
|
|
|
|
|
|
} |
293
|
|
|
|
|
|
|
)->( $_[2], q[""] ); |
294
|
|
|
|
|
|
|
) |
295
|
|
|
|
|
|
|
? scalar( |
296
|
|
|
|
|
|
|
do { local $_ = $_[2]; Path::Tiny::path($_) } |
297
|
|
|
|
|
|
|
) |
298
|
|
|
|
|
|
|
: ( ( ref( $_[2] ) eq 'ARRAY' ) ) ? scalar( |
299
|
|
|
|
|
|
|
do { local $_ = $_[2]; Path::Tiny::path(@$_) } |
300
|
|
|
|
|
|
|
) |
301
|
|
|
|
|
|
|
: $_[2]; |
302
|
|
|
|
|
|
|
( |
303
|
|
|
|
|
|
|
do { |
304
|
|
|
|
|
|
|
use Scalar::Util (); |
305
|
|
|
|
|
|
|
Scalar::Util::blessed($tmp) and $tmp->isa(q[Path::Tiny]); |
306
|
|
|
|
|
|
|
} |
307
|
|
|
|
|
|
|
) |
308
|
|
|
|
|
|
|
or croak( |
309
|
|
|
|
|
|
|
"Type check failed in signature for change_parent_dir: %s should be %s", |
310
|
|
|
|
|
|
|
"\$_[2]", "Path" |
311
|
|
|
|
|
|
|
); |
312
|
|
|
|
|
|
|
push( @out, $tmp ); |
313
|
|
|
|
|
|
|
|
314
|
|
|
|
|
|
|
do { @_ = ( @head, @out ); goto $__NEXT__ }; |
315
|
|
|
|
|
|
|
}; |
316
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
$SIGNATURE_FOR{"fix_pm_to_blib"} = sub { |
318
|
|
|
|
|
|
|
my $__NEXT__ = shift; |
319
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
my ( @out, %tmp, $tmp, $dtmp, @head ); |
321
|
|
|
|
|
|
|
|
322
|
|
|
|
|
|
|
@_ == 3 |
323
|
|
|
|
|
|
|
or |
324
|
|
|
|
|
|
|
croak( "Wrong number of parameters in signature for %s: got %d, %s", |
325
|
|
|
|
|
|
|
"fix_pm_to_blib", scalar(@_), "expected exactly 3 parameters" ); |
326
|
|
|
|
|
|
|
|
327
|
1
|
|
|
1
|
|
7
|
@head = splice( @_, 0, 1 ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
209
|
|
328
|
|
|
|
|
|
|
|
329
|
|
|
|
|
|
|
# Parameter invocant (type: Defined) |
330
|
|
|
|
|
|
|
( defined( $head[0] ) ) |
331
|
|
|
|
|
|
|
or croak( |
332
|
|
|
|
|
|
|
"Type check failed in signature for fix_pm_to_blib: %s should be %s", |
333
|
|
|
|
|
|
|
"\$_[0]", "Defined" |
334
|
|
|
|
|
|
|
); |
335
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
# Parameter $_[0] (type: Path) |
337
|
|
|
|
|
|
|
$tmp = ( |
338
|
|
|
|
|
|
|
( |
339
|
|
|
|
|
|
|
do { |
340
|
|
|
|
|
|
|
use Scalar::Util (); |
341
|
|
|
|
|
|
|
Scalar::Util::blessed( $_[0] ) |
342
|
|
|
|
|
|
|
and $_[0]->isa(q[Path::Tiny]); |
343
|
|
|
|
|
|
|
} |
344
|
|
|
|
|
|
|
) |
345
|
|
|
|
|
|
|
) ? $_[0] : ( |
346
|
|
|
|
|
|
|
do { |
347
|
|
|
|
|
|
|
|
348
|
|
|
|
|
|
|
defined( $_[0] ) and do { |
349
|
|
|
|
|
|
|
ref( \$_[0] ) eq 'SCALAR' |
350
|
|
|
|
|
|
|
or ref( \( my $val = $_[0] ) ) eq 'SCALAR'; |
351
|
|
|
|
|
|
|
} |
352
|
|
|
|
|
|
|
) |
353
|
|
|
|
|
|
|
? scalar( |
354
|
|
|
|
|
|
|
do { local $_ = $_[0]; Path::Tiny::path($_) } |
355
|
|
|
|
|
|
|
) |
356
|
|
|
|
|
|
|
: ( |
357
|
|
|
|
|
|
|
do { |
358
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
defined( $_[0] ) && !ref( $_[0] ) |
360
|
|
|
|
|
|
|
or Scalar::Util::blessed( $_[0] ) && ( |
361
|
|
|
|
|
|
|
sub { |
362
|
|
|
|
|
|
|
require overload; |
363
|
1
|
|
|
1
|
|
7
|
overload::Overloaded( ref $_[0] or $_[0] ) |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
239
|
|
364
|
|
|
|
|
|
|
and overload::Method( ( ref $_[0] or $_[0] ), $_[1] ); |
365
|
|
|
|
|
|
|
} |
366
|
|
|
|
|
|
|
)->( $_[0], q[""] ); |
367
|
|
|
|
|
|
|
) |
368
|
|
|
|
|
|
|
? scalar( |
369
|
|
|
|
|
|
|
do { local $_ = $_[0]; Path::Tiny::path($_) } |
370
|
|
|
|
|
|
|
) |
371
|
|
|
|
|
|
|
: ( ( ref( $_[0] ) eq 'ARRAY' ) ) ? scalar( |
372
|
|
|
|
|
|
|
do { local $_ = $_[0]; Path::Tiny::path(@$_) } |
373
|
|
|
|
|
|
|
) |
374
|
|
|
|
|
|
|
: $_[0]; |
375
|
|
|
|
|
|
|
( |
376
|
|
|
|
|
|
|
do { |
377
|
|
|
|
|
|
|
use Scalar::Util (); |
378
|
|
|
|
|
|
|
Scalar::Util::blessed($tmp) and $tmp->isa(q[Path::Tiny]); |
379
|
|
|
|
|
|
|
} |
380
|
|
|
|
|
|
|
) |
381
|
|
|
|
|
|
|
or croak( |
382
|
|
|
|
|
|
|
"Type check failed in signature for fix_pm_to_blib: %s should be %s", |
383
|
|
|
|
|
|
|
"\$_[1]", "Path" |
384
|
|
|
|
|
|
|
); |
385
|
|
|
|
|
|
|
push( @out, $tmp ); |
386
|
|
|
|
|
|
|
|
387
|
|
|
|
|
|
|
# Parameter $_[1] (type: Path) |
388
|
|
|
|
|
|
|
$tmp = ( |
389
|
|
|
|
|
|
|
( |
390
|
|
|
|
|
|
|
do { |
391
|
|
|
|
|
|
|
use Scalar::Util (); |
392
|
|
|
|
|
|
|
Scalar::Util::blessed( $_[1] ) |
393
|
|
|
|
|
|
|
and $_[1]->isa(q[Path::Tiny]); |
394
|
|
|
|
|
|
|
} |
395
|
|
|
|
|
|
|
) |
396
|
|
|
|
|
|
|
) ? $_[1] : ( |
397
|
|
|
|
|
|
|
do { |
398
|
|
|
|
|
|
|
|
399
|
|
|
|
|
|
|
defined( $_[1] ) and do { |
400
|
|
|
|
|
|
|
ref( \$_[1] ) eq 'SCALAR' |
401
|
|
|
|
|
|
|
or ref( \( my $val = $_[1] ) ) eq 'SCALAR'; |
402
|
|
|
|
|
|
|
} |
403
|
|
|
|
|
|
|
) |
404
|
1
|
|
|
1
|
|
6
|
? scalar( |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
55
|
|
405
|
|
|
|
|
|
|
do { local $_ = $_[1]; Path::Tiny::path($_) } |
406
|
|
|
|
|
|
|
) |
407
|
|
|
|
|
|
|
: ( |
408
|
|
|
|
|
|
|
do { |
409
|
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
defined( $_[1] ) && !ref( $_[1] ) |
411
|
|
|
|
|
|
|
or Scalar::Util::blessed( $_[1] ) && ( |
412
|
|
|
|
|
|
|
sub { |
413
|
|
|
|
|
|
|
require overload; |
414
|
|
|
|
|
|
|
overload::Overloaded( ref $_[0] or $_[0] ) |
415
|
|
|
|
|
|
|
and overload::Method( ( ref $_[0] or $_[0] ), $_[1] ); |
416
|
|
|
|
|
|
|
} |
417
|
|
|
|
|
|
|
)->( $_[1], q[""] ); |
418
|
1
|
|
|
1
|
|
6
|
) |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
195
|
|
419
|
|
|
|
|
|
|
? scalar( |
420
|
|
|
|
|
|
|
do { local $_ = $_[1]; Path::Tiny::path($_) } |
421
|
|
|
|
|
|
|
) |
422
|
|
|
|
|
|
|
: ( ( ref( $_[1] ) eq 'ARRAY' ) ) ? scalar( |
423
|
|
|
|
|
|
|
do { local $_ = $_[1]; Path::Tiny::path(@$_) } |
424
|
|
|
|
|
|
|
) |
425
|
|
|
|
|
|
|
: $_[1]; |
426
|
|
|
|
|
|
|
( |
427
|
|
|
|
|
|
|
do { |
428
|
|
|
|
|
|
|
use Scalar::Util (); |
429
|
|
|
|
|
|
|
Scalar::Util::blessed($tmp) and $tmp->isa(q[Path::Tiny]); |
430
|
|
|
|
|
|
|
} |
431
|
|
|
|
|
|
|
) |
432
|
|
|
|
|
|
|
or croak( |
433
|
|
|
|
|
|
|
"Type check failed in signature for fix_pm_to_blib: %s should be %s", |
434
|
|
|
|
|
|
|
"\$_[2]", "Path" |
435
|
|
|
|
|
|
|
); |
436
|
|
|
|
|
|
|
push( @out, $tmp ); |
437
|
|
|
|
|
|
|
|
438
|
|
|
|
|
|
|
do { @_ = ( @head, @out ); goto $__NEXT__ }; |
439
|
|
|
|
|
|
|
}; |
440
|
|
|
|
|
|
|
|
441
|
|
|
|
|
|
|
1; |