[Catalyst] forward() return behaviour

Peter Karman peter at peknet.com
Wed Feb 1 20:51:42 CET 2006


hello fellow cattle-lusters,

I'm not seeing behaviour I expect from the forward() method. Specifically, it 
doesn't return all the values of the forwarded method, but only the last one:

-----------snip----------------
package MyApp;

sub test_forward : Private
{
     my ($self,$c) = @_;
     my @forward = $c->forward('foo');
     my @self = $self->foo;

     for ( @forward )
     {
         $c->log->debug("$_ was forwarded");
     }
     for ( @self )
     {
         $c->log->debug("$_ was self'd");
     }

}

sub foo : Private
{
     return( qw/ bix bza asd / );
}
-----------snip----------------

[Wed Feb  1 13:47:29 2006] [catalyst] [debug] "GET" request for "" from "127.0.0.1"
[Wed Feb  1 13:47:29 2006] [catalyst] [debug] asd was forwarded
[Wed Feb  1 13:47:29 2006] [catalyst] [debug] bix was self'd
[Wed Feb  1 13:47:29 2006] [catalyst] [debug] bza was self'd
[Wed Feb  1 13:47:29 2006] [catalyst] [debug] asd was self'd


perldoc Catalyst claims:

Any data C<return>ed from the action forwarded to, will be returned by the
call to forward.


Am I misinterpreting? In the wrong universe? ... wait, don't answer the last 
question.

I'm using Catalyst version 5.61.

thanks
-- 
Peter Karman  .  http://peknet.com/  .  peter at peknet.com




More information about the Catalyst mailing list