develooper Front page | perl.perl5.porters | Postings from February 2013

Re: Don't patch perlopentut: rewrite it completely

Thread Previous | Thread Next
From:
H.Merijn Brand
Date:
February 17, 2013 19:29
Subject:
Re: Don't patch perlopentut: rewrite it completely
Message ID:
20130217202853.5f0722ca@pc09.procura.nl
On Sun, 17 Feb 2013 10:28:23 -0700, Tom Christiansen <tchrist@perl.com>
wrote:

> Johan Vromans <jvromans@squirrel.nl> wrote
>    on Sun, 17 Feb 2013 14:24:15 +0100: 
> 
> >> I strongly favor showing "or die..." instead of "|| die..." because
> >> the lower precedence operator is safer should parentheses be omitted.
> 
> > I second this preference, but for a different reason: I advice people to
> > use || for expressions, and or for statements. Although technically
> > speaking all (well, most) statements are also expressions, it is more
> > intuitive to mentally make the distinction where appropriate.
> 
> The compromise that Larry and I came up with is that I got to keep 
> my parens and he got to keep his "or die".
> 
> The only remaining problem is that that breaks the lovely parallelism 
> of "|| die" on false and "// die" on undef.
> 
>     my $line   = <STDIN>		// die "no input on stdin";
>     my $kidpid = open(CHILD, "|-") 	// die "cannot fork: $!";

/me is in favor of bringing back the dor (or err) keyword!
(not joking)

-- 
H.Merijn Brand  http://tux.nl   Perl Monger  http://amsterdam.pm.org/
using perl5.00307 .. 5.17   porting perl5 on HP-UX, AIX, and openSUSE
http://mirrors.develooper.com/hpux/        http://www.test-smoke.org/
http://qa.perl.org   http://www.goldmark.org/jeff/stupid-disclaimers/

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About