Why not
sub auto :Private {
my $c = pop;
return user_logged_in || $c->redirect( ... );
}
Cheers.
--m
----- Original Message -----
From: "Jonathan Rockway" <[email protected]>
To: "The elegant MVC web framework" <[email protected]>
Sent: Tuesday, January 27, 2009 2:44:55 PM GMT -06:00 US/Canada Central
Subject: Re: [Catalyst] Re: Detach won't detach?
* On Mon, Jan 26 2009, Aristotle Pagaltzis wrote:
> sub auto :Private {
> my ( $self, $c ) = @_;
>
> return 1 if user_logged_in;
>
> $c->redirect( $c->req->base );
> return 0;
> }
If we are playing golf, I submit:
sub auto :Private {
my $c = pop;
return user_logged_in || $c->redirect( ... ) || 0;
}
Now I have that much more disk space free for pr0n!
Regards,
Jonathan Rockway
--
print just => another => perl => hacker => if $,=$"
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/