perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ed Grimm <>
Subject Re: Embperl::Object and ErrorDocument
Date Sun, 24 Nov 2002 01:18:38 GMT
Have a per-request data store (such as the Apache request record) in
which you place your error messages.  So, instead of 'my $errs', you
have something like '$r->errs'.  (Please note that I don't actually use
the Apache request record for this; as such, I don't know if that was
the right syntax for doing so, nor do I know if I managed to step on a
pre-existing Apache request record key.)

I find myself using this sort of mechanism more frequently for general
deep parameter passing.  (That is, I have a subroutine which is six
calls deep called from the first Embperl block; it aquires data which is
needed by a subroutine eight calls deep, called from the third Embperl
block.  Either I need to pass that variable through fourteen subroutine
calls (well, six returns and eight calls), or I need to use a global
(evil, evil), or I need to do something like this.)

If you do this but don't use the Apache request record, you need to be
careful to clean up your data after each request, and you either need to
use a non-threaded webserver, or you need to be careful to remain


On Sat, 23 Nov 2002, Jordan Baker wrote:

> Aha, well I discovered something by testing tonite.
> I do a couple Execute calls in my base.epl and essentially they hide
> the error from the parent process.
> So I have to find a way to propogate errors.. perhaps there is an
> option to Execute to propogate errors when you call another document
> but it apparently does not work in this case... ie. execution will
> continue.
> So my temporary work around is to rethrow the errors I receive in this
> case...
> The only annoying thing is that I need to do this for any file I
> Execute from the base.epl and it gets a bit redundant.. which is why
> it would be nice to be able to propogate the error back to the top
> unless you have "errors" set to something.
> my $errs = [];
> Execute({inputfile => "*", errors => $errs});
> # rethrow error
> die join("\n", @$errs) if $errs;
> Anyone else using Embperl::Object who has any other advice?? This will
> help me in a basic regard anway so I'm mostly happy :)
> --
> Jordan Baker
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message