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