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

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

Thread Previous | Thread Next
H.Merijn Brand
April 5, 2010 00:50
Re: RFC: Perl manual pages -- update to follow the perlstyle.podguidelines
Message ID:
On Sun, 04 Apr 2010 09:24:39 -0600, Tom Christiansen <>

> In-Reply-To: Message from Marvin Humphrey <>
>    of "Sun, 04 Apr 2010 08:13:12 PDT." <>
> >> I don't read function calls without a ) as having their arguments term<SNIP>
> >> 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?
> I doubt it's all that personal.

I agree. Not that I take the same road as Tom everywhere, but the perl
documentation is not something personal. It is written for ALL users.
Novices and experts. As this thread already has proven that minds don't
think alike, there is very clearly not a `better' way to write || or or
to make things safer or more readable.

I use both. Tom uses parens and ||, and Jari uses or. Lets keep the
versatility in the docs. The current docs are not wrong.

> > (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.
> That depends on your literary predilections, I suppose.

What a beatiful word. Never heard of it before.

pred·i·lec·tion  (prdl-kshn, prd-)

A partiality or disposition in favor of something; a preference.

[French prédilection, from Old French, from Medieval Latin praedlctus,
past participle of praedligere, to prefer : Latin prae-, pre- + Latin
dligere, to love; see diligent.] Synonyms: predilection, bias, leaning,
partiality, penchant, prejudice, proclivity, propensity These nouns
denote a predisposition to favor someone or something particular: a
predilection for classical composers; a pro-American bias; conservative
leanings; a partiality for liberal-minded friends; a penchant for
exotic foods; a prejudice in favor of the underprivileged; a proclivity
for self-assertiveness; a propensity for exaggeration.

The American Heritage® Dictionary of the English Language, Fourth
Edition copyright ©2000 by Houghton Mifflin Company. Updated in 2009.
Published by Houghton Mifflin Company. All rights reserved.

predilection [ˌpriːdɪˈlɛkʃən]
a predisposition, preference, or bias

[from French prédilection, from Medieval Latin praedīligere to prefer,
from Latin prae before + dīligere to love]

Collins English Dictionary – Complete and Unabridged 6th Edition 2003.
© William Collins Sons & Co. Ltd 1979, 1986 © HarperCollins Publishers
1991, 1994, 1998, 2000, 2003

> >  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 "||"?
> Nothing.
> I'm a far stronger advocated of parens around arguments than I am for ||.
> If you use parens, it doesn't matter which or or || you use.  I find
> I read things a lot easier with punctuation that without.  Lack of grouping
> punctuation makes things harder to read.
> You don't address the problem of having too many tricky levels of precedence
> by creating two more levels of precedences.  That's what clever people to do,
> and it just makes the problem worse.
> You solve it by using parens.

H.Merijn Brand      Perl Monger
using & porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,
11.11, 11.23, and 11.31, OpenSuSE 10.3, 11.0, and 11.1, AIX 5.2 and 5.3. 

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About