From: Tomas Doran Date: Tue, 20 Mar 2012 11:27:24 +0000 (+0000) Subject: Default to zero everywhere, to stop the warnings in splice below X-Git-Tag: 5.90012~9 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=d0a02856666b38a92f5905e86e11fd053dff91bd Default to zero everywhere, to stop the warnings in splice below --- diff --git a/lib/Catalyst/DispatchType/Chained.pm b/lib/Catalyst/DispatchType/Chained.pm index fcdc49e..3b7b0c4 100644 --- a/lib/Catalyst/DispatchType/Chained.pm +++ b/lib/Catalyst/DispatchType/Chained.pm @@ -201,9 +201,10 @@ sub recurse_match { 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