> I'd like to be able to prematurely end the thread of execution
> within a Perl apache module from someplace *other than* the
> PerlHandler entry point subroutine (usually "handler()"). That is,
> when I'm a few subroutines deep inside my module, I want to be able
> to spit out an error page and have the module finish as if handler()
> had returned OK. Right now I'm painstakingly propagating return
> values back up to my handler() subroutine, but I'm hoping there's a
> better way.
>
You could use "eval" and "die", Perl's standard exception mechanism.
sub handler
{
my $r = shift;
eval {
foo();
}
warn $@ if $@;
}
sub foo
{
goo();
}
sub goo
{
...
die "prematurely" if $some_condition;
}
--
Eric
- Intentional Premature Finish in an Apache Module Public Interactive
- Re: Intentional Premature Finish in an Apache Modu... Ken Y. Clark
- Re: Intentional Premature Finish in an Apache ... John Siracusa
- Re: Intentional Premature Finish in an Apa... Ken Y. Clark
- Re: Intentional Premature Finish in an... John Siracusa
- Re: Intentional Premature Finish in an... Andrei A. Voropaev
- Re: Intentional Premature Finish in an Apache Modu... Doug MacEachern
- Re: Intentional Premature Finish in an Apache ... John Siracusa
- Re: Intentional Premature Finish in an Apa... Doug MacEachern
- Re: Intentional Premature Finish in an Apache Modu... Eric Cholet
- Re: Intentional Premature Finish in an Apache ... Public Interactive
- RE: Intentional Premature Finish in an Apache Modu... Eric Cholet
- Re: Intentional Premature Finish in an Apache Modu... Public Interactive
- RE: Intentional Premature Finish in an Apache Modu... Eric Cholet
- RE: Intentional Premature Finish in an Apache Modu... Young, Geoffrey S.
