I think you want the 'come-from' statement (the inverse of a
goto-statement). I believe this is under development, and should be
available shortly after the end of March.
- Roger -
----- Original Message -----
From: "Richard J. Barbalace" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 04, 2002 3:41 PM
Subject: Re: Resume after die?
> I 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";
> > };
> > if ($@) {
> > # Handle the exception
> > # Resume at the line following the exception
> > }
> >
> > Is there a way of resuming after the die statement? If not, is there
> > a standard way of resuming after exception handling in Perl? I have
> > code that allows redoing the entire eval block or simply continuing
> > after the eval block, but I have not found any way to resume inside
> > the eval block.
>
> Maybe I wasn't clear so people took the "die" command too literally.
> There might not be a "die" command in the code at all. It might be
> a subroutine that calls "die", or some statement that causes a runtime
> exception, or any other means of raising a normally-fatal exception:
> eval {
> # Code where an error may occur
> exception_causing_method();
> # Code where I want to resume after handling the exception
> print "Continuing....\n";
> };
>
> I want to handle the exception and then resume execution at the following
> line, regardless of how the exception is caused. Can anyone recommend a
> technique to do this type of resumptive exception handling in perl? I
> suspect it involves something more complicated than an eval {BLOCK} form.
>
> Thanks.
> + Richard J. Barbalace
> Cambridge, MA
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]