develooper Front page | perl.perl5.porters | Postings from April 2010

Re: RFC: Perl manual pages -- update to follow the perlstyle.pod guidelines

Thread Previous | Thread Next
From:
Marvin Humphrey
Date:
April 4, 2010 08:13
Subject:
Re: RFC: Perl manual pages -- update to follow the perlstyle.pod guidelines
Message ID:
20100404151312.GA23850@rectangular.com
On Sun, Apr 04, 2010 at 08:26:23AM -0600, Tom Christiansen wrote:
> I don't read function calls without a ) as having their arguments terminated.
> The ) || works much, much, much better for me.
> 
> I always use ||.  Always.  And I do *not* make precedence errors, because
> even if I forgot them, I also always use ).

Wouldn't that usage of "||" instead of "or" be a personal idiosyncrasy, then?
(Presumably an artifact of your C background?)  I'm agnostic about the
readability, but as a language construct, "or" is more appropriate.

FWIW, I also always use parens around the arguments to open, for much the same
reasons that you do (though I don't typically use parens for "close").  But I
always use low-precedence "or" because the "or die" idiom was drilled into
my head by Perl canon literature.

  open(my $fh, '<', 'foo.txt') or die $!;
  ...
  close $fh or die $!;

So even if we don't strip the parens, what's wrong with using "or" instead 
of "||"?

Marvin Humphrey


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