diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-12-09 04:00:23 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-12-09 04:00:23 +0000 |
commit | 39429b3b45b7029694dcb200fceedc0a2e6174fb (patch) | |
tree | d3bf3361213b8cb151e453e48b7fd06dd990f8e8 /pod | |
parent | a0be28da97d0d38b5ef9181812da403f4e9ce11f (diff) | |
download | perl-39429b3b45b7029694dcb200fceedc0a2e6174fb.tar.gz |
document compatibility issue with literal list slices and NOTOP
(C<not (1,2,3)[0]> is now a syntax error)
p4raw-id: //depot/perl@4673
Diffstat (limited to 'pod')
-rw-r--r-- | pod/perldelta.pod | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 5fba7687be..924996dbac 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -125,6 +125,28 @@ The undocumented special variable C<%@> that used to accumulate has been removed, because it could potentially result in memory leaks. +=item Parenthesized not() behaves like a list operator + +The C<not> operator now falls under the "if it looks like a function, +it behaves like a function" rule. + +As a result, the parenthesized form can be used with C<grep> and C<map>. +The following construct used to be a syntax error before, but it works +as expected now: + + grep not($_), @things; + +On the other hand, using C<not> with a literal list slice may not +work. The following previously allowed construct: + + print not (1,2,3)[0]; + +needs to written with additional parentheses now: + + print not((1,2,3)[0]); + +The behavior remains unaffected when C<not> is not followed by parentheses. + =back =head2 C Source Incompatibilities |