EvdB has asked for the wisdom of the Perl Monks concerning the following question:
This is achieved in cgiapp_init (simplified somewhat):
I would much rather have some better way of exiting than just calling exit. It would be nice to have some form of variable/flag that could be set to stop the execution of the remaining functions but would let things like the teardown run.sub cgiapp_init { my $self = shift; my $user = $self->get_user_from_cookie(); unless ( defined $user ) { print $self->query->redirect('/login.pl'); exit; } $self->{user} = $user; return 1; }
How have others dealt with this?
--tidiness is the memory loss of environmental mnemonics
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Strategies for exiting early for CGI::Application based webapp.
by LTjake (Prior) on Oct 22, 2003 at 20:01 UTC | |
|
Re: Strategies for exiting early for CGI::Application based webapp.
by cees (Curate) on Oct 22, 2003 at 18:04 UTC | |
|
Re: Strategies for exiting early for CGI::Application based webapp.
by talexb (Chancellor) on Oct 22, 2003 at 14:40 UTC | |
by EvdB (Deacon) on Oct 22, 2003 at 15:04 UTC | |
by talexb (Chancellor) on Oct 22, 2003 at 16:14 UTC | |
|
Re: Strategies for exiting early for CGI::Application based webapp.
by Anonymous Monk on Oct 22, 2003 at 14:50 UTC | |
by EvdB (Deacon) on Oct 22, 2003 at 15:01 UTC | |
by valdez (Monsignor) on Oct 22, 2003 at 16:48 UTC |