Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Journal of LTjake (4001)

Wednesday August 16, 2006
02:35 PM

Catalyst Tip: Were we forwarded here?

[ #30656 ]

A handy little tip -- if you need to figure out if you're inside a forwarded action or not do this simple comparison:

if( $c->action eq $c->stack->[ -1 ] ) {
    # We've not been forwarded yet

$c->action is the Catalyst::Action object for the current action and $c->stack->[ -1 ] is the Catalyst::Action for the current sub (which will always be the last item in the call stack).

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.