David J Radunz wrote:
Well, all of these scripts run under PerlRun - so I either have to make
that change in every one of them, and every module they load. Like, if I
set the SIG{__WARN__} at the top of a script and a module set it,
wouldn't it then be 'reset' ?

Why would any module mungle with %SIG? That's a very bad idea. It should be set once at the startup by the user, normally for debug purposes and never touched by the core modules.


If you still have the case where the modules you use reset %SIG, simply modify PerlRun.pm to log the truncated error. Let me know if you need help with that. (search for $@ and truncate it)

David

On Wed, 2005-04-06 at 01:00 -0400, Stas Bekman wrote:

Stas Bekman wrote:

David J Radunz wrote:


Sounds great - yet obvious. I would have to do about 2 years worth of
work to fix all of the bugs. I didn't create them either, I fix them in
my own code - but we have so much code base. I wanted a mod_perl
solution to overcome this issue by filtering the error.


If that's the case, why don't you adjust your %SIG wrappers to truncate the error length? It's relatively easy:

use Carp qw(confess cluck);
$SIG{__DIE__}  = sub { die  substr Carp::longmess(@_), 0, TRUNCATE };
$SIG{__WARN__} = sub { warn substr Carp::longmess(@_), 0, TRUNCATE };

Sorry, it should have been:

use constant TRUNCATE => 40;
use Carp ();
$SIG{__DIE__}  = sub { die  substr Carp::longmess(@_), 0, TRUNCATE };
$SIG{__WARN__} = sub { warn substr Carp::longmess(@_), 0, TRUNCATE };



This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. Please notify the sender immediately by email if you have received this email by mistake and delete this email from your system. Please note that any views or opinions presented in this email are solely
those of the author and do not necessarily represent those of the organisation. Finally, the recipient should check this email and any attachments for the presence of viruses. The organisation accepts no liability for any damage caused by any virus transmitted by this email.


--
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Reply via email to