I do not know what advantages the try statement would have in perl.
However, in Java programming it makes exception handling more explicit.  It
basically allows the programmer to "try" a certain action and see what the
effects are going to be (i.e. handle the exception) so that some action can
then be taken based on the results of the exception.  If no exception
happens then the code did exactly as you expected.  If not, then perhaps the
action was not appropriate for that peice of code.  This can be useful in an
OO application.

- Bradley S. Behrens

-----Original Message-----
From: Graham Barr [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 16, 2000 3:23 AM
To: David L. Nicol
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Re: "Try? There is no try." -- Yoda's Exception handling syntax


On Tue, Aug 15, 2000 at 08:11:55PM +0000, David L. Nicol wrote:
> Would someone please enlighten me as to the purpose of an explicit "try."

In my mind it allows the important code to come before the "oh crap
something
went wrong" code.

Graham.

Reply via email to