summaryrefslogtreecommitdiff
path: root/pod
diff options
context:
space:
mode:
authorStephen McCamant <smcc@mit.edu>2002-12-09 19:57:07 -0500
committerhv <hv@crypt.org>2002-12-11 10:35:01 +0000
commitcaec1979d2248e31dd6f584f10772d0aa0d7cf92 (patch)
tree8d80f53d24af416e7e1ba8f125db0654a963deea /pod
parentdcdfe71d1fa3e8177f52e29e82a4b89579e68ad2 (diff)
downloadperl-caec1979d2248e31dd6f584f10772d0aa0d7cf92.tar.gz
Re: Precedence of ? :
Message-Id: <20021210055707.974F073CCC@syllepsis> p4raw-id: //depot/perl@18285
Diffstat (limited to 'pod')
-rw-r--r--pod/perldelta.pod17
1 files changed, 17 insertions, 0 deletions
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index 8704322575..1394824bfe 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -22,6 +22,23 @@ contains a package variable named C<$NEGATIVE_INDICES> which is set to
a true value, negative values will be passed to C<FETCH>, C<STORE>,
C<EXISTS>, and C<DELETE> unchanged.
+=head2 Fewer parentheses needed with C<? :>
+
+The grammar of the conditional operator (C<$x ? $y : $z>) has been
+broadened so that any operator may appear between the C<?> and the
+C<:> without parentheses. Previously, the comma operator and the
+low-precedence logical operators had required parentheses in this
+context. For instance, you may now write
+
+ $x ? $a and $b : $c
+
+as a shorter version of the more explicit
+
+ $x ? ($a and $b) : $c
+
+Perl is now compatible with C in this regard. However, writing the
+parentheses is still recommended as a matter of style.
+
=head1 Modules and Pragmata
=head1 Utility Changes