* Michael G Schwern <[EMAIL PROTECTED]> [2007-02-27 06:25]:
> $SIG{__DIE__} = sub {
>     # We don't want to muck with death in an eval, but $^S isn't
>     # totally reliable.  5.005_03 and 5.6.1 both do the wrong thing
>     # with it.  Instead, we use caller.  This also means it runs under
>     # 5.004!
>     my $in_eval = 0;
>     for( my $stack = 1;  my $sub = (CORE::caller($stack))[3];  $stack++ ) {
>         $in_eval = 1 if $sub =~ /^\(eval\)/;
>     }
>     ...
> };
> 
> That's how you do it "right" and maintain any sort of backwards compatibility.

Owh goodnessssss arrrrragh *twitch*

Together with the contortions required to safely examine $@ after
an eval I’m getting tempted to put Unbreak::Eval on the CPAN.

-- 
*AUTOLOAD=*_;sub _{s/(.*)::(.*)/print$2,(",$\/"," ")[defined wantarray]/e;$1}
&Just->another->Perl->hack;
#Aristotle

Reply via email to