diff options
author | Ludovic E. R. Tolhurst-Cleaver <camel@ltcdev.com> | 2015-08-17 21:30:59 -0400 |
---|---|---|
committer | James E Keenan <jkeenan@cpan.org> | 2015-08-17 21:39:04 -0400 |
commit | bf55d65d91cd95545972d61170706df20eba4db2 (patch) | |
tree | 262d8723ac932dea6063d1d6402e2760aa59bc8c /pod/perlop.pod | |
parent | 7c0c544ccc3283021df458dc39fb3638b44c2d6e (diff) | |
download | perl-bf55d65d91cd95545972d61170706df20eba4db2.tar.gz |
Clarify functioning of '||' operator.
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
Diffstat (limited to 'pod/perlop.pod')
-rw-r--r-- | pod/perlop.pod | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pod/perlop.pod b/pod/perlop.pod index bed06959a6..b7ebbb1892 100644 --- a/pod/perlop.pod +++ b/pod/perlop.pod @@ -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). |