Skip to content

Commit 44254e7

Browse files
briandfoykhwilliamson
authored andcommitted
result of ^^ is not the last evaluated expression.
The ^^ operator can't return the last evaluated expression since it could either be true or false, and would not indicate the success of the XOR. You can see this by using ^^: $ perl -E 'say q(A) ^^ q(B)' $ perl -E 'say q(0) ^^ q(B)' 1
1 parent f9d2dee commit 44254e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pod/perlop.pod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,7 @@ cannot). This is very useful for
10891089
providing default values for variables. If you actually want to test if
10901090
at least one of C<$x> and C<$y> is defined, use S<C<defined($x // $y)>>.
10911091

1092-
The C<||>, C<^^> and C<//> operators return the last value evaluated
1092+
The C<||> and C<//> operators return the last value evaluated
10931093
(unlike C's C<||> which returns 0 or 1). Thus, a reasonably
10941094
portable way to find out the home directory might be:
10951095

0 commit comments

Comments
 (0)