in reply to Exception catching sub

Automatically rethrowing (die $@) prevents you from catching several different types of exceptions in a series of elsifs -- I think you probably only want to rethrow if none of your catches match: if ( eval ... ) { ... } elsif ( catch("E") ) { ... } elsif ( catch("F") ) { ... } else { die $@; }

Replies are listed 'Best First'.
Re: Re: Exception catching sub
by bsb (Priest) on Sep 02, 2003 at 23:37 UTC
    Good point. Thanks.