This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Clarify functioning of '||' operator.
authorLudovic E. R. Tolhurst-Cleaver <camel@ltcdev.com>
Tue, 18 Aug 2015 01:30:59 +0000 (21:30 -0400)
committerJames E Keenan <jkeenan@cpan.org>
Tue, 18 Aug 2015 01:39:04 +0000 (21:39 -0400)
Follow wording from Camel book, 4th ed., p. 120, per suggestion by
Ludovic E. R. Tolhurst-Cleaver.  Add Ludovic E. R. Tolhurst-Cleaver
to AUTHORS.

For: RT #125802

AUTHORS
pod/perlop.pod

diff --git a/AUTHORS b/AUTHORS
index c795d6b..c844e9e 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -735,6 +735,7 @@ Louis Strous                        <louis.strous@gmail.com>
 Luc St-Louis                   <luc.st-louis@ca.transport.bombardier.com>
 Luca Fini
 Lucas Holt                     <luke@foolishgames.com>
+Ludovic E. R. Tolhurst-Cleaver                 <camel@ltcdev.com>
 Lukas Mai                      <l.mai@web.de>
 Luke Closs                     <lukec@cpan.org>
 Luke Ross                      <lukeross@gmail.com>
index bed0695..b7ebbb1 100644 (file)
@@ -924,9 +924,9 @@ portable way to find out the home directory might be:
 In particular, this means that you shouldn't use this
 for selecting between two aggregates for assignment:
 
-    @a = @b || @c;             # this is wrong
-    @a = scalar(@b) || @c;     # really meant this
-    @a = @b ? @b : @c;         # this works fine, though
+    @a = @b || @c;            # This doesn't do the right thing
+    @a = scalar(@b) || @c;    # because it really means this.
+    @a = @b ? @b : @c;        # This works fine, though.
 
 As alternatives to C<&&> and C<||> when used for
 control flow, Perl provides the C<and> and C<or> operators (see below).