X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FActionChain.pm;h=6b08e2b107eded5c2eb8e25dca79b3737453cfa2;hp=ceb7c81abbf3e41e8ba4e39e77fd9363aa6817b0;hb=ee1ac3770d375006a96f1fba8308c1294e82e633;hpb=d79627719bedb6dc937f3373cebe7de967cd3fad diff --git a/lib/Catalyst/ActionChain.pm b/lib/Catalyst/ActionChain.pm index ceb7c81..6b08e2b 100644 --- a/lib/Catalyst/ActionChain.pm +++ b/lib/Catalyst/ActionChain.pm @@ -49,7 +49,9 @@ actions in order. sub dispatch { my ( $self, $c ) = @_; my @captures = @{$c->req->captures||[]}; - foreach my $action ( @{ $self->chain } ) { + my @chain = @{ $self->chain }; + my $last = pop(@chain); + foreach my $action ( @chain ) { my @args; if (my $cap = $action->attributes->{Captures}) { @args = splice(@captures, 0, $cap->[0]); @@ -57,6 +59,7 @@ sub dispatch { local $c->request->{arguments} = \@args; $action->dispatch( $c ); } + $last->dispatch( $c ); } =head2 from_chain( \@actions )