my @try_actions = @{$children->{$try_part}};
TRY_ACTION: foreach my $action (@try_actions) {
if (my $capture_attr = $action->attributes->{CaptureArgs}) {
+ $capture_attr ||= 0;
# Short-circuit if not enough remaining parts
- next TRY_ACTION unless @parts >= ($capture_attr->[0]||0);
+ next TRY_ACTION unless @parts >= $capture_attr->[0];
my @captures;
my @parts = @parts; # localise
my $curr = $action;
while ($curr) {
if (my $cap = $curr->attributes->{CaptureArgs}) {
- return undef unless @captures >= $cap->[0]; # not enough captures
+ return undef unless @captures >= ($cap->[0]||0); # not enough captures
if ($cap->[0]) {
unshift(@parts, splice(@captures, -$cap->[0]));
}
you C<detach> out of a chain, the rest of the chain will not get called
after the C<detach>.
+=head2 match_captures
+
+A method which can optionally be implemented by actions to
+stop chain matching.
+
+See L<Catalyst::Action> for further details.
+
=head1 AUTHORS
Catalyst Contributors, see Catalyst.pm