Message from discussion
'catch' statement modifier
Newsgroups: perl.perl6.language
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.perl.org
Return-Path: <d...@lighthouse.tamucc.edu>
Mailing-List: contact perl6-language-h...@perl.org; run by ezmlm
Delivered-To: mailing list perl6-langu...@perl.org
Delivered-To: moderator for perl6-langu...@perl.org
Delivered-To: perl6-langu...@perl.org
Date: Sun, 23 Nov 2003 14:52:17 -0600
To: Austin Hastings <Austin_Hasti...@Yahoo.com>
Cc: Damian Conway <dam...@conway.org>, perl6-langu...@perl.org
Subject: Re: 'catch' statement modifier
Message-ID: <20031123205217.GA13033@lighthouse.tamucc.edu>
Reply-To: d...@lighthouse.tamucc.edu
Mail-Followup-To: Austin Hastings <Austin_Hasti...@Yahoo.com>, Damian Conway <dam...@conway.org>, perl6-langu...@perl.org
References: <3FC11775.3080504@conway.org> <ICELKKFHGNOHCNCCCBKFEEPPCHAA.Austin_Hastings@Yahoo.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <ICELKKFHGNOHCNCCCBKFEEPPCHAA.Austin_Hastings@Yahoo.com>
User-Agent: Mutt/1.4.1i
X-Spam-Check-By: one.develooper.com
X-Spam-Status: No, hits=-2.7 required=7.0 tests=CARRIAGE_RETURNS,IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES,SPAM_PHRASE_00_01,USER_AGENT,USER_AGENT_MUTT version=2.44
X-SMTPD: qpsmtpd/0.26, http://develooper.com/code/qpsmtpd/
Approved: n...@nntp.perl.org
From: d...@lighthouse.tamucc.edu (Jonathan Scott Duff)
Lines: 38
On Sun, Nov 23, 2003 at 03:53:00PM -0500, Austin Hastings wrote:
> > -----Original Message-----
> > From: Damian Conway [mailto:dam...@conway.org]
> >
> > Remember that a C<try> without a C<CATCH> catches all exceptions
> > and returns
> > C<undef> (the same as a Perl 5 C<eval> block does).
> >
> > So you just want:
> >
> > try { $opus.write_to_file($file) }
> > err die "Couldn't write to $file: $!\n";
>
> Is that C<err die> or C<or die> ?
>
> And if so, what's C<err> and where can I find more on it?
Exegesis 4 ...
In Apocalypse 3, Larry introduced the // operator, which is
like a || that tests its left operand for definedness rather
than truth.
What he didn't mention (but which you probably guessed) was that
there is also the low-precedence version of //. Its name is err:
Operation High Precedence Low Precedence
INCLUSIVE OR || or
EXCLUSIVE OR ~~ xor
DEFINED OR // err
This is in the "Read or Die" section of E4 if you want to read more.
-Scott
--
Jonathan Scott Duff
d...@lighthouse.tamucc.edu