On Tue, Aug 15, 2000 at 04:39:24PM -0700, Peter Scott wrote:
> >PRL> =head2 Exception classes - ignoring
> >
> >PRL> Note that we could also make it possible to selectively or globally 
> >ignore
> >PRL> exceptions, so that perl continues executing the line after the C<throw>
> >PRL> statement.  Just import a C<ignore> function that takes a class name:
> >
> >PRL>      ignore Exception::IO;     # Ignore all I/O exceptions
> >PRL>      ignore Exception;         # Ignore all exceptions
> >
> >PRL> and when perl sees the C<throw>, it just does nothing.  (Or do it by
> >PRL> overriding a base class method as for C<implicit_rethrow> if you 
> >don't want
> >PRL> to put another function in the namespace.)  Since C<throw> and C<die>
> >PRL> should be essentially identical, this would allow any kind of 
> >exception to
> >PRL> be ignored, not just the ones that were C<throw>n.  This is not 
> >necessarily
> >PRL> a good thing, of course.
> >
> >
> >Oh, no! Are you really suggesting that after
> >
> >         open (FOO, "nonesuch") or throw "file not found"
> >
> >The next statement continues??????
> >
> >How in $DIETY's name do you expect to protect code?
> 
> I said it wasn't necessarily a good thing :-)  It's in the grand Perl 
> tradition of giving you enough rope to hang yourself.  If someone really 
> chooses to ignore exceptions, they deserve what they get.  Or maybe, 
> they're some kind of wizard who has a good reason in some arcane 
> situation.  If you like we could stuff it in a Devel:: module.  But at 
> least one person had asked for this IIRC.

This is bad, VERY bad. This is action at a distance worse than the current
$SIG{__DIE__} situation which nobody likes.

Graham.

Reply via email to