Re: Exception handlers [was: Traps for module writers]
Nick Ing-Simmons (nik@tiuk.ti.com)
Wed, 27 Nov 1996 08:51:01 GMT
Daniel Laliberte <liberte@ncsa.uiuc.edu> writes:
>Nick Ing-Simmons <nik@tiuk.ti.com> writes:
>
> > Don't need a keyword - we can use a prototype - wrote this for Tk
> > yesterday in light of this thread here :
> >
> >
> > # a wrapper on eval {} which turns off user $SIG{__DIE__}
> > sub catch (&)
> > {
> > my $sub = shift;
> > eval {local $SIG{'__DIE__'}; &$sub };
> > }
>
>A standard routine like this 'catch' will be useful, but I think the
>name should be changed.
No problem there - I will leave to others to argue general exception
handling.
(I chose 'catch' as above Tk::catch has (I hope) same semantics
as Tcl's 'catch' command.)