line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
{ |
2
|
|
|
|
|
|
|
use strict; |
3
|
1
|
|
|
1
|
|
22
|
use warnings; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
77
|
|
4
|
1
|
|
|
1
|
|
18
|
no warnings qw( once void ); |
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
105
|
|
5
|
1
|
|
|
1
|
|
13
|
|
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
305
|
|
6
|
|
|
|
|
|
|
our $USES_MITE = "Mite::Class"; |
7
|
|
|
|
|
|
|
our $MITE_SHIM = "Mite::Shim"; |
8
|
|
|
|
|
|
|
our $MITE_VERSION = "0.010008"; |
9
|
|
|
|
|
|
|
# Mite keywords |
10
|
|
|
|
|
|
|
BEGIN { |
11
|
|
|
|
|
|
|
my ( $SHIM, $CALLER ) = ( "Mite::Shim", "MyTest3" ); |
12
|
1
|
|
|
1
|
|
5
|
( *after, *around, *before, *extends, *field, *has, *param, *signature_for, *with ) = do { |
13
|
1
|
|
|
|
|
2
|
no warnings 'redefine'; |
14
|
|
|
|
|
|
|
( |
15
|
1
|
|
|
1
|
|
23
|
sub { $SHIM->HANDLE_after( $CALLER, "class", @_ ) }, |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
402
|
|
16
|
|
|
|
|
|
|
sub { $SHIM->HANDLE_around( $CALLER, "class", @_ ) }, |
17
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_before( $CALLER, "class", @_ ) }, |
18
|
0
|
|
|
|
|
0
|
sub {}, |
19
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_has( $CALLER, field => @_ ) }, |
20
|
|
|
|
|
|
|
sub { $SHIM->HANDLE_has( $CALLER, has => @_ ) }, |
21
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_has( $CALLER, param => @_ ) }, |
22
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_signature_for( $CALLER, "class", @_ ) }, |
23
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_with( $CALLER, @_ ) }, |
24
|
1
|
|
|
|
|
12
|
); |
25
|
0
|
|
|
|
|
0
|
}; |
26
|
1
|
|
|
|
|
230
|
|
27
|
|
|
|
|
|
|
# Mite imports |
28
|
|
|
|
|
|
|
BEGIN { |
29
|
|
|
|
|
|
|
require Scalar::Util; |
30
|
|
|
|
|
|
|
*STRICT = \&Mite::Shim::STRICT; |
31
|
|
|
|
|
|
|
*bare = \&Mite::Shim::bare; |
32
|
1
|
|
|
1
|
|
8
|
*blessed = \&Scalar::Util::blessed; |
33
|
1
|
|
|
|
|
9
|
*carp = \&Mite::Shim::carp; |
34
|
1
|
|
|
|
|
3
|
*confess = \&Mite::Shim::confess; |
35
|
1
|
|
|
|
|
2
|
*croak = \&Mite::Shim::croak; |
36
|
1
|
|
|
|
|
9
|
*false = \&Mite::Shim::false; |
37
|
1
|
|
|
|
|
8
|
*guard = \&Mite::Shim::guard; |
38
|
1
|
|
|
|
|
8
|
*lazy = \&Mite::Shim::lazy; |
39
|
1
|
|
|
|
|
3
|
*ro = \&Mite::Shim::ro; |
40
|
1
|
|
|
|
|
7
|
*rw = \&Mite::Shim::rw; |
41
|
1
|
|
|
|
|
6
|
*rwp = \&Mite::Shim::rwp; |
42
|
1
|
|
|
|
|
3
|
*true = \&Mite::Shim::true; |
43
|
1
|
|
|
|
|
9
|
}; |
44
|
1
|
|
|
|
|
4
|
|
45
|
1
|
|
|
|
|
37
|
# Gather metadata for constructor and destructor |
46
|
|
|
|
|
|
|
no strict 'refs'; |
47
|
|
|
|
|
|
|
my $class = shift; $class = ref($class) || $class; |
48
|
|
|
|
|
|
|
my $linear_isa = mro::get_linear_isa( $class ); |
49
|
|
|
|
|
|
|
return { |
50
|
1
|
|
|
1
|
|
9
|
BUILD => [ |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
650
|
|
51
|
1
|
|
33
|
1
|
|
1
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
1
|
|
|
|
|
7
|
|
52
|
1
|
|
|
|
|
11
|
map { "$_\::BUILD" } reverse @$linear_isa |
53
|
|
|
|
|
|
|
], |
54
|
|
|
|
|
|
|
DEMOLISH => [ |
55
|
2
|
50
|
|
|
|
6
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
2
|
|
|
|
|
73
|
|
|
0
|
|
|
|
|
0
|
|
56
|
2
|
|
|
|
|
5
|
map { "$_\::DEMOLISH" } @$linear_isa |
57
|
|
|
|
|
|
|
], |
58
|
|
|
|
|
|
|
HAS_BUILDARGS => $class->can('BUILDARGS'), |
59
|
2
|
50
|
|
|
|
2
|
HAS_FOREIGNBUILDARGS => $class->can('FOREIGNBUILDARGS'), |
|
2
|
|
|
|
|
19
|
|
|
0
|
|
|
|
|
0
|
|
60
|
1
|
|
|
|
|
3
|
}; |
|
2
|
|
|
|
|
4
|
|
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
# Standard Moose/Moo-style constructor |
65
|
|
|
|
|
|
|
my $class = ref($_[0]) ? ref(shift) : shift; |
66
|
|
|
|
|
|
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
67
|
|
|
|
|
|
|
my $self = bless {}, $class; |
68
|
|
|
|
|
|
|
my $args = $meta->{HAS_BUILDARGS} ? $class->BUILDARGS( @_ ) : { ( @_ == 1 ) ? %{$_[0]} : @_ }; |
69
|
|
|
|
|
|
|
my $no_build = delete $args->{__no_BUILD__}; |
70
|
1
|
50
|
|
1
|
|
2167
|
|
71
|
1
|
|
33
|
|
|
8
|
|
72
|
1
|
|
|
|
|
4
|
|
73
|
1
|
50
|
|
|
|
39
|
# Call BUILD methods |
|
0
|
50
|
|
|
|
0
|
|
74
|
1
|
|
|
|
|
4
|
$self->BUILDALL( $args ) if ( ! $no_build and @{ $meta->{BUILD} || [] } ); |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
# Unrecognized parameters |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
return $self; |
79
|
1
|
50
|
33
|
|
|
4
|
} |
|
1
|
50
|
|
|
|
6
|
|
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
# Used by constructor to call BUILD methods |
82
|
1
|
0
|
|
|
|
1
|
my $class = ref( $_[0] ); |
|
0
|
0
|
|
|
|
0
|
|
|
0
|
50
|
|
|
|
0
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
3
|
|
83
|
|
|
|
|
|
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
84
|
1
|
|
|
|
|
30
|
$_->( @_ ) for @{ $meta->{BUILD} || [] }; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
# Destructor should call DEMOLISH methods |
88
|
|
|
|
|
|
|
my $self = shift; |
89
|
0
|
|
|
0
|
|
0
|
my $class = ref( $self ) || $self; |
90
|
0
|
|
0
|
|
|
0
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
91
|
0
|
0
|
|
|
|
0
|
my $in_global_destruction = defined ${^GLOBAL_PHASE} |
|
0
|
|
|
|
|
0
|
|
92
|
|
|
|
|
|
|
? ${^GLOBAL_PHASE} eq 'DESTRUCT' |
93
|
|
|
|
|
|
|
: Devel::GlobalDestruction::in_global_destruction(); |
94
|
|
|
|
|
|
|
for my $demolisher ( @{ $meta->{DEMOLISH} || [] } ) { |
95
|
|
|
|
|
|
|
my $e = do { |
96
|
1
|
|
|
1
|
|
92
|
local ( $?, $@ ); |
97
|
1
|
|
33
|
|
|
4
|
eval { $demolisher->( $self, $in_global_destruction ) }; |
98
|
1
|
|
33
|
|
|
4
|
$@; |
99
|
1
|
50
|
|
|
|
4
|
}; |
100
|
|
|
|
|
|
|
no warnings 'misc'; # avoid (in cleanup) warnings |
101
|
|
|
|
|
|
|
die $e if $e; # rethrow |
102
|
1
|
50
|
|
|
|
2
|
} |
|
1
|
|
|
|
|
6
|
|
103
|
0
|
|
|
|
|
0
|
return; |
104
|
0
|
|
|
|
|
0
|
} |
105
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
106
|
0
|
|
|
|
|
0
|
|
107
|
|
|
|
|
|
|
# See UNIVERSAL |
108
|
1
|
|
|
1
|
|
10
|
my ( $self, $role ) = @_; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
710
|
|
109
|
0
|
0
|
|
|
|
0
|
our %DOES; |
110
|
|
|
|
|
|
|
return $DOES{$role} if exists $DOES{$role}; |
111
|
1
|
|
|
|
|
4
|
return 1 if $role eq __PACKAGE__; |
112
|
|
|
|
|
|
|
if ( $INC{'Moose/Util.pm'} and my $meta = Moose::Util::find_meta( ref $self or $self ) ) { |
113
|
|
|
|
|
|
|
$meta->can( 'does_role' ) and $meta->does_role( $role ) and return 1; |
114
|
|
|
|
|
|
|
} |
115
|
|
|
|
|
|
|
return $self->SUPER::DOES( $role ); |
116
|
|
|
|
|
|
|
} |
117
|
44
|
|
|
44
|
|
53
|
|
118
|
44
|
|
|
|
|
29
|
# Alias for Moose/Moo-compatibility |
119
|
44
|
50
|
|
|
|
57
|
shift->DOES( @_ ); |
120
|
44
|
50
|
|
|
|
46
|
} |
121
|
44
|
50
|
0
|
|
|
61
|
|
|
|
|
33
|
|
|
|
|
122
|
0
|
0
|
0
|
|
|
0
|
# Method signatures |
123
|
|
|
|
|
|
|
our %SIGNATURE_FOR; |
124
|
44
|
|
|
|
|
143
|
|
125
|
|
|
|
|
|
|
$SIGNATURE_FOR{"foo"} = sub { |
126
|
|
|
|
|
|
|
my $__NEXT__ = shift; |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
my ( %out, %in, %tmp, $tmp, $dtmp, @head ); |
129
|
22
|
|
|
22
|
|
1042
|
|
130
|
|
|
|
|
|
|
@_ == 2 && (ref($_[1]) eq 'HASH') |
131
|
|
|
|
|
|
|
or @_ % 2 == 1 && @_ == 5 |
132
|
|
|
|
|
|
|
or croak( "Wrong number of parameters in signature for %s: got %d, %s", "foo", scalar( @_ ), "that does not seem right" ); |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
@head = splice( @_, 0, 1 ); |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
# Parameter invocant (type: Defined) |
137
|
|
|
|
|
|
|
(defined($head[0])) |
138
|
|
|
|
|
|
|
or croak( "Type check failed in signature for foo: %s should be %s", "\$_[0]", "Defined" ); |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
%in = ( @_ == 1 and (ref($_[0]) eq 'HASH') ) ? %{ $_[0] } : @_; |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
# Parameter xxx (type: Int) |
143
|
|
|
|
|
|
|
exists( $in{"xxx"} ) |
144
|
|
|
|
|
|
|
or croak( "Failure in signature for foo: " . 'Missing required parameter: xxx' ); |
145
|
|
|
|
|
|
|
(do { my $tmp = $in{"xxx"}; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) |
146
|
|
|
|
|
|
|
or croak( "Type check failed in signature for foo: %s should be %s", "\$_{\"xxx\"}", "Int" ); |
147
|
|
|
|
|
|
|
$out{"xxx"} = $in{"xxx"} if exists( $in{"xxx"} ); |
148
|
|
|
|
|
|
|
delete( $in{"xxx"} ); |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
# Parameter yyy (type: Bool) |
151
|
|
|
|
|
|
|
exists( $in{"yyy"} ) |
152
|
|
|
|
|
|
|
or croak( "Failure in signature for foo: " . 'Missing required parameter: yyy' ); |
153
|
|
|
|
|
|
|
(!ref $tmp and (!defined $tmp or $tmp eq q() or $tmp eq '0' or $tmp eq '1')) |
154
|
|
|
|
|
|
|
or croak( "Type check failed in signature for foo: %s should be %s", "\$_{\"yyy\"}", "Bool" ); |
155
|
|
|
|
|
|
|
$out{"yyy"} = $tmp; |
156
|
|
|
|
|
|
|
delete( $in{"yyy"} ); |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
# Unrecognized parameters |
159
|
|
|
|
|
|
|
croak( "Failure in signature for foo: " . sprintf( q{Unrecognized parameter%s: %s}, keys( %in ) > 1 ? q{s} : q{}, join( q{, }, sort keys %in ) ) ) if keys %in; |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
do { @_ = ( @head, bless( \%out, "MyTest3::__NAMED_ARGUMENTS__::foo" ) ); goto $__NEXT__ }; |
162
|
|
|
|
|
|
|
}; |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
{ |
165
|
|
|
|
|
|
|
use strict; |
166
|
|
|
|
|
|
|
no warnings; |
167
|
|
|
|
|
|
|
1; |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
1; |
171
|
|
|
|
|
|
|
use strict; |
172
|
|
|
|
|
|
|
use warnings; |
173
|
|
|
|
|
|
|
no warnings qw( once void ); |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
our $USES_MITE = "Mite::Class"; |
176
|
|
|
|
|
|
|
our $MITE_SHIM = "Mite::Shim"; |
177
|
1
|
|
|
1
|
|
6
|
our $MITE_VERSION = "0.010008"; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
30
|
|
178
|
1
|
|
|
1
|
|
4
|
# Mite keywords |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
112
|
|
179
|
0
|
|
|
0
|
|
0
|
BEGIN { |
180
|
0
|
|
|
0
|
|
0
|
my ( $SHIM, $CALLER ) = ( "Mite::Shim", "MyTest4" ); |
181
|
|
|
|
|
|
|
( *after, *around, *before, *extends, *field, *has, *param, *signature_for, *with ) = do { |
182
|
|
|
|
|
|
|
no warnings 'redefine'; |
183
|
|
|
|
|
|
|
( |
184
|
|
|
|
|
|
|
sub { $SHIM->HANDLE_after( $CALLER, "class", @_ ) }, |
185
|
|
|
|
|
|
|
sub { $SHIM->HANDLE_around( $CALLER, "class", @_ ) }, |
186
|
|
|
|
|
|
|
sub { $SHIM->HANDLE_before( $CALLER, "class", @_ ) }, |
187
|
|
|
|
|
|
|
sub {}, |
188
|
1
|
|
|
1
|
|
13
|
sub { $SHIM->HANDLE_has( $CALLER, field => @_ ) }, |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
35
|
|
189
|
1
|
|
|
1
|
|
4
|
sub { $SHIM->HANDLE_has( $CALLER, has => @_ ) }, |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
41
|
|
190
|
1
|
|
|
1
|
|
5
|
sub { $SHIM->HANDLE_has( $CALLER, param => @_ ) }, |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
146
|
|
191
|
|
|
|
|
|
|
sub { $SHIM->HANDLE_signature_for( $CALLER, "class", @_ ) }, |
192
|
|
|
|
|
|
|
sub { $SHIM->HANDLE_with( $CALLER, @_ ) }, |
193
|
|
|
|
|
|
|
); |
194
|
|
|
|
|
|
|
}; |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
# Mite imports |
197
|
1
|
|
|
1
|
|
5
|
BEGIN { |
198
|
1
|
|
|
|
|
1
|
require Scalar::Util; |
199
|
|
|
|
|
|
|
*STRICT = \&Mite::Shim::STRICT; |
200
|
1
|
|
|
1
|
|
6
|
*bare = \&Mite::Shim::bare; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
197
|
|
201
|
|
|
|
|
|
|
*blessed = \&Scalar::Util::blessed; |
202
|
0
|
|
|
|
|
0
|
*carp = \&Mite::Shim::carp; |
203
|
0
|
|
|
|
|
0
|
*confess = \&Mite::Shim::confess; |
204
|
0
|
|
|
|
|
0
|
*croak = \&Mite::Shim::croak; |
205
|
|
|
|
|
|
|
*false = \&Mite::Shim::false; |
206
|
0
|
|
|
|
|
0
|
*guard = \&Mite::Shim::guard; |
207
|
0
|
|
|
|
|
0
|
*lazy = \&Mite::Shim::lazy; |
208
|
0
|
|
|
|
|
0
|
*ro = \&Mite::Shim::ro; |
209
|
1
|
|
|
|
|
4
|
*rw = \&Mite::Shim::rw; |
210
|
0
|
|
|
|
|
0
|
*rwp = \&Mite::Shim::rwp; |
211
|
1
|
|
|
|
|
149
|
*true = \&Mite::Shim::true; |
212
|
|
|
|
|
|
|
}; |
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
BEGIN { |
216
|
|
|
|
|
|
|
|
217
|
1
|
|
|
1
|
|
6
|
|
218
|
1
|
|
|
|
|
3
|
use mro 'c3'; |
219
|
1
|
|
|
|
|
2
|
our @ISA; |
220
|
1
|
|
|
|
|
2
|
push @ISA, "MyTest3"; |
221
|
1
|
|
|
|
|
3
|
} |
222
|
1
|
|
|
|
|
6
|
|
223
|
1
|
|
|
|
|
2
|
|
224
|
1
|
|
|
|
|
1
|
# See UNIVERSAL |
225
|
1
|
|
|
|
|
2
|
my ( $self, $role ) = @_; |
226
|
1
|
|
|
|
|
6
|
our %DOES; |
227
|
1
|
|
|
|
|
3
|
return $DOES{$role} if exists $DOES{$role}; |
228
|
1
|
|
|
|
|
1
|
return 1 if $role eq __PACKAGE__; |
229
|
1
|
|
|
|
|
2
|
if ( $INC{'Moose/Util.pm'} and my $meta = Moose::Util::find_meta( ref $self or $self ) ) { |
230
|
1
|
|
|
|
|
367
|
$meta->can( 'does_role' ) and $meta->does_role( $role ) and return 1; |
231
|
|
|
|
|
|
|
} |
232
|
|
|
|
|
|
|
return $self->SUPER::DOES( $role ); |
233
|
|
|
|
|
|
|
} |
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
# Alias for Moose/Moo-compatibility |
236
|
|
|
|
|
|
|
shift->DOES( @_ ); |
237
|
1
|
|
|
1
|
|
6
|
} |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
17
|
|
238
|
1
|
|
|
1
|
|
37
|
|
239
|
1
|
|
|
|
|
661
|
# Method signatures |
240
|
|
|
|
|
|
|
our %SIGNATURE_FOR; |
241
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
$SIGNATURE_FOR{"foo"} = sub { |
243
|
|
|
|
|
|
|
my $__NEXT__ = shift; |
244
|
|
|
|
|
|
|
|
245
|
22
|
|
|
22
|
|
27
|
my ( %out, %in, %tmp, $tmp, $dtmp, @head ); |
246
|
22
|
|
|
|
|
16
|
|
247
|
22
|
50
|
|
|
|
31
|
@_ == 2 && (ref($_[1]) eq 'HASH') |
248
|
22
|
50
|
|
|
|
23
|
or @_ % 2 == 1 && @_ == 7 |
249
|
22
|
50
|
0
|
|
|
29
|
or croak( "Wrong number of parameters in signature for %s: got %d, %s", "foo", scalar( @_ ), "that does not seem right" ); |
|
|
|
33
|
|
|
|
|
250
|
0
|
0
|
0
|
|
|
0
|
|
251
|
|
|
|
|
|
|
@head = splice( @_, 0, 1 ); |
252
|
22
|
|
|
|
|
27
|
|
253
|
|
|
|
|
|
|
# Parameter $head[0] (type: Str) |
254
|
|
|
|
|
|
|
or croak( "Type check failed in signature for foo: %s should be %s", "\$_[0]", "Str" ); |
255
|
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
%in = ( @_ == 1 and (ref($_[0]) eq 'HASH') ) ? %{ $_[0] } : @_; |
257
|
22
|
|
|
22
|
|
1258
|
|
258
|
|
|
|
|
|
|
# Parameter xxx (type: Int) |
259
|
|
|
|
|
|
|
exists( $in{"xxx"} ) |
260
|
|
|
|
|
|
|
or croak( "Failure in signature for foo: " . 'Missing required parameter: xxx' ); |
261
|
|
|
|
|
|
|
(do { my $tmp = $in{"xxx"}; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) |
262
|
|
|
|
|
|
|
or croak( "Type check failed in signature for foo: %s should be %s", "\$_{\"xxx\"}", "Int" ); |
263
|
|
|
|
|
|
|
$out{"xxx"} = $in{"xxx"} if exists( $in{"xxx"} ); |
264
|
|
|
|
|
|
|
delete( $in{"xxx"} ); |
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
# Parameter yyy (type: Bool) |
267
|
|
|
|
|
|
|
exists( $in{"yyy"} ) |
268
|
|
|
|
|
|
|
or croak( "Failure in signature for foo: " . 'Missing required parameter: yyy' ); |
269
|
|
|
|
|
|
|
(!ref $tmp and (!defined $tmp or $tmp eq q() or $tmp eq '0' or $tmp eq '1')) |
270
|
|
|
|
|
|
|
or croak( "Type check failed in signature for foo: %s should be %s", "\$_{\"yyy\"}", "Bool" ); |
271
|
|
|
|
|
|
|
$out{"yyy"} = $tmp; |
272
|
|
|
|
|
|
|
delete( $in{"yyy"} ); |
273
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
# Parameter zzz (type: Any) |
275
|
|
|
|
|
|
|
exists( $in{"zzz"} ) |
276
|
|
|
|
|
|
|
or croak( "Failure in signature for foo: " . 'Missing required parameter: zzz' ); |
277
|
|
|
|
|
|
|
1; # ... nothing to do |
278
|
|
|
|
|
|
|
$out{"zzz"} = $in{"zzz"} if exists( $in{"zzz"} ); |
279
|
|
|
|
|
|
|
delete( $in{"zzz"} ); |
280
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
# Unrecognized parameters |
282
|
|
|
|
|
|
|
croak( "Failure in signature for foo: " . sprintf( q{Unrecognized parameter%s: %s}, keys( %in ) > 1 ? q{s} : q{}, join( q{, }, sort keys %in ) ) ) if keys %in; |
283
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
do { @_ = ( @head, bless( \%out, "MyTest4::__NAMED_ARGUMENTS__::foo" ) ); goto $__NEXT__ }; |
285
|
|
|
|
|
|
|
}; |
286
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
{ |
288
|
|
|
|
|
|
|
use strict; |
289
|
|
|
|
|
|
|
no warnings; |
290
|
|
|
|
|
|
|
1; |
291
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
1; |