On 6/8/07, Jim Spath <[EMAIL PROTECTED]> wrote:

What is the consensus on returning values from a call to forward?

I've seen a mailing list post stating that one should not rely on return
values from forward():

http://www.mail-archive.com/[email protected]/msg03519.html

But the Catalyst docs seem to indicate that returning values is allowed
as long as you are aware of the the consequences:


http://search.cpan.org/~mramberg/Catalyst-Runtime-5.7007/lib/Catalyst.pm#$c-%3Eforward(_$action_[,[EMAIL
 PROTECTED])

Anyways, just wanted to get a sense of what people think.

- Jim

_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive:
http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/



My personal opinion on it is to never use return values from ->forward.  If
you need the data, stick it in the stash.  I also find it very useful to
setup structured stash key definitions along with a glossary to keep things
sane.

For instance, if I'm holding onto any result sets in a chain, or forwards,
those always go to ->stash->{resultset}->{foo} (where foo is typically the
action name used to generate the resultset).

It's kept my applications extensible and pretty clean.

-Jay

--
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com
_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to