perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: Filter and Handlers should not reset $@ if it was set before entering
Date Mon, 09 Aug 2004 21:51:33 GMT
Philippe M. Chiasson wrote:

>> Would it be better to localize $@ instead of copying and restoring it?
> I wish we could do that, and it was the first thing I attempted.
> The problem is that if we do that, even conditionnaly only when $@ is set
> on entry, it means that any _real_ errors triggered during the execution
> of the handler (setting $@) will also be lost and replaced with the 
> previous
> value for $@.
> That's why we need to save $@ if it was set, and only restore if nothing
> failed during handler execution, otherwise we squish the new $@.

I see. So in case the filter has failed, and the response handler has 
failed we won't see the error from a response handler. So that solves 
only half a problem, as we still lose handlers $@

That's why I thought that it'll be better to find a different place to 
localize $@, i.e. outside the scope of the code that runs the handler 
and checks $@ on return. but this is probably not quite feasible. How 
about making a special case for filters (inside the filters code).

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker     mod_perl Guide --->

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

View raw message