perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lincoln Stein <lst...@cshl.org>
Subject Re: CGI::Carp
Date Sun, 11 May 2003 23:07:22 GMT
The fact is that this:

	*CORE::GLOBAL::die = \&mydie;

Does not work with 5.6.0 or 5.6.1 and I am getting bug reports regarding 
CGI::Carp.  Here is a test script:

#!/usr/bin/perl 
 
use strict; 
*CORE::GLOBAL::die = \&mydie; 
 
print STDERR "VERSION = $]\n"; 
print STDERR "line 1\n"; 
die "dieing here\n"; 
print STDERR "line 2\n"; 
 
sub mydie { 
  print STDERR "In die handler\n"; 
  die $@; 
} 
 
When I run it, I get:

VERSION = 5.006 
line 1 
dieing here 

Rather than the expected "In die handler" message.

Please tell me what I am doing wrong.

Lincoln

On Monday 05 May 2003 04:44 pm, Jarkko Hietaniemi wrote:
> > CGI::Carp is no longer working consistently for all combinations of
> > Perl and mod_perl versions.  One way I have found to solve most of
> > the problems people are reporting is to backtrack and go back to
> > replacing the die handler this way:
> >
> > 	$SIG{__DIE__} = \&mydie;
> >
> > rather than
> >
> > 	*CORE::GLOBAL::die =&mydie;
> >
> > as is currently the case.
> >
> > The mailing lists are very confused (and confusing) on the issue of
> > the magic $SIG{__DIE__} data structure.  Can you offer any advice?
>
> What seems to be the, umm, confusion?  Reading perlfunc and perlvar
> on the subject I would say that $SIG{__DIE__} should *not* be used
> currently if one wants to write a 'handler' for die().  The problem
> is that the $SIG{__DIE__} is called also in evals.

-- 
Lincoln Stein
lstein@cshl.org
Cold Spring Harbor Laboratory
1 Bungtown Road
Cold Spring Harbor, NY 11724
(516) 367-8380 (voice)
(516) 367-8389 (fax)


Mime
View raw message