diff options
author | Stephen McCamant <smcc@mit.edu> | 2002-12-09 19:57:07 -0500 |
---|---|---|
committer | hv <hv@crypt.org> | 2002-12-11 10:35:01 +0000 |
commit | caec1979d2248e31dd6f584f10772d0aa0d7cf92 (patch) | |
tree | 8d80f53d24af416e7e1ba8f125db0654a963deea /pod/perldelta.pod | |
parent | dcdfe71d1fa3e8177f52e29e82a4b89579e68ad2 (diff) | |
download | perl-caec1979d2248e31dd6f584f10772d0aa0d7cf92.tar.gz |
Re: Precedence of ? :
Message-Id: <20021210055707.974F073CCC@syllepsis>
p4raw-id: //depot/perl@18285
Diffstat (limited to 'pod/perldelta.pod')
-rw-r--r-- | pod/perldelta.pod | 17 |
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 |