X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FEngine.pm;h=ba926cb0ba48969a2bb5cbc8b1bdd652b6cf0f9a;hb=b96d41e6a80ff8d00e4030e55c0fc1ae8c11aa76;hp=8d84e858d5c3d9211b7d405c6fec89ab041130ae;hpb=9113e2701050e4a0ba3011916043edd24881651e;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index 8d84e85..ba926cb 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -373,11 +373,11 @@ sub handler ($$) { for my $begin ( @{ $c->get_action( 'begin', $namespace ) } ) { $c->state( $c->execute( @{ $begin->[0] } ) ); } - for my $result ( @{ $c->get_action( $action, $default ) } ) { + for my $result ( @{ $c->get_action( $action, $default ) }[-1] ) { $c->state( $c->execute( @{ $result->[0] } ) ); last unless $default; } - for my $end ( @{ $c->get_action( 'end', $namespace ) } ) { + for my $end ( reverse @{ $c->get_action( 'end', $namespace ) } ) { $c->state( $c->execute( @{ $end->[0] } ) ); } }