[Catalyst] Returning values from forward()

J. Shirley jshirley at gmail.com
Fri Jun 8 20:45:08 GMT 2007

On 6/8/07, Jim Spath <jspath at pangeamedia.com> 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/catalyst@lists.rawmode.org/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#=
> Anyways, just wanted to get a sense of what people think.
> - Jim
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.rawmode.org/
> 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

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.


-- =

J. Shirley :: jshirley at gmail.com :: Killing two stones with one bird...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070608/d4533=

More information about the Catalyst mailing list