Re: [Catalyst] Re: Detach won't detach?

2009-01-29 Thread Octavian Rasnita
I thought that this discussion was about perl golf... Octavian - Original Message - From: "Jonathan Rockway" To: "The elegant MVC web framework" Sent: Thursday, January 29, 2009 1:33 PM Subject: Re: [Catalyst] Re: Detach won't detach? >* On Thu, Jan 29

Re: [Catalyst] Re: Detach won't detach?

2009-01-29 Thread Jonathan Rockway
* On Thu, Jan 29 2009, Octavian Rasnita wrote: > I see. In that case $_->[-1] could be used instead of $c, but it is not very > nice... BTW, I thought I would reply to this thread and remind everyone that this is just supposed to be funny at this point. If you actually write your code this way,

Re: [Catalyst] Re: Detach won't detach?

2009-01-28 Thread Octavian Rasnita
I see. In that case $_->[-1] could be used instead of $c, but it is not very nice... Octavian - Original Message - From: "Matthias Dietrich" To: "The elegant MVC web framework" Sent: Wednesday, January 28, 2009 7:58 PM Subject: Re: [Catalyst]

Re: [Catalyst] Re: Detach won't detach?

2009-01-28 Thread Matthias Dietrich
On 28.01.2009 at 08:33 Octavian Rasnita wrote: Why not: sub auto :Private { return user_logged_in || pop->redirect( ... ) || 0; } Because there used to be $c->req->base within the parentheses... Without that, this would work. matt -- rainboxx Matthias Dietrich Freier Software Engineer

Re: [Catalyst] Re: Detach won't detach?

2009-01-28 Thread Jonas Alves
-- Jonas 2009/1/28 Jonathan Rockway > * On Tue, Jan 27 2009, pie3...@comcast.net wrote: > > Why not > > > > sub auto :Private { > > my $c = pop; > > return user_logged_in || $c->res->redirect( ... ); > > } > > Because now the correctness of your application depends on undoc

Re: [Catalyst] Re: Detach won't detach?

2009-01-28 Thread Octavian Rasnita
From: > Why not > sub auto :Private { > my $c = pop; > return user_logged_in || $c->redirect( ... ); > } Why not: sub auto :Private { return user_logged_in || pop->redirect( ... ) || 0; } Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo

[Catalyst] Re: Detach won't detach?

2009-01-27 Thread Aristotle Pagaltzis
* Jonathan Rockway [2009-01-27 21:50]: > If we are playing golf, I submit: No, it was my way of saying that if I wanted to see Pascal, I know where to find it. Regards, -- Aristotle Pagaltzis // ___ List: Catalyst@lists.scsy

Re: [Catalyst] Re: Detach won't detach?

2009-01-27 Thread Andrew Rodland
On Tuesday 27 January 2009 05:33:46 pm Jonathan Rockway wrote: > * On Tue, Jan 27 2009, pie3...@comcast.net wrote: > > Why not > > > > sub auto :Private { > > my $c = pop; > > return user_logged_in || $c->res->redirect( ... ); > > } > > Because now the correctness of your applic

Re: [Catalyst] Re: Detach won't detach?

2009-01-27 Thread Jonathan Rockway
* On Tue, Jan 27 2009, pie3...@comcast.net wrote: > Why not > > sub auto :Private { > my $c = pop; > return user_logged_in || $c->res->redirect( ... ); > } Because now the correctness of your application depends on undocumented behavior (the return value of $c->res->redirect).

Re: [Catalyst] Re: Detach won't detach?

2009-01-27 Thread pie3142
: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->

Re: [Catalyst] Re: Detach won't detach?

2009-01-27 Thread Jonathan Rockway
* 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;

[Catalyst] Re: Detach won't detach?

2009-01-26 Thread Aristotle Pagaltzis
* Lars Balker Rasmussen [2009-01-26 20:10]: > sub auto :Private { > my ( $self, $c ) = @_; > > if ( ! user_logged_in) { > $c->redirect( $c->req->base ); > return 0; > } > > return 1; > } sub auto :Private { my ( $self, $c ) = @_; return 1 if user_logged_in;