X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FActionChain.pm;h=6b08e2b107eded5c2eb8e25dca79b3737453cfa2;hb=e5c7adea1c2115b30ff57b2f6e6035020c5216d3;hp=ceb7c81abbf3e41e8ba4e39e77fd9363aa6817b0;hpb=d79627719bedb6dc937f3373cebe7de967cd3fad;p=catagits%2FCatalyst-Runtime.git 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 )