At 10:41 AM 1/4/2002 -0500, Richard J. Barbalace wrote:
> > I'm looking into ways to do resumptive exception handling in Perl. For
> > example, I have something equivalent to:
> > eval {
> > # Code where an error may occur
> > die "Here's an exception";
> > # Code where I want to resume after handling the exception
> > print "Continuing....\n";
> > };
I thnik you're out of luck. I thought there was an avenue like this:
#!/usr/bin/perl -wl
use strict;
$SIG{__DIE__}=sub{print"Dying..."; goto after };
print"Before";
die"foo";
after: print "After";
But no matter what I try, it says it can't find the label. I was going off
this section of perlvar:
When a __DIE__ hook routine returns, the exception
processing continues as it would have in the
absence of the hook, unless the hook routine
itself exits via a "goto", a loop exit, or a
die().
I wonder whether the goto part is still accurate.
Peter Scott
[EMAIL PROTECTED]
http://www.perldebugged.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]