summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-11-03 15:33:55 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-11-03 15:33:55 +0000
commit2f65b2f0bd345fd58390bf7bbb7e2f9c96839f76 (patch)
treec4dc639d378b019cc7a4c76b807c6328822ad396
parent3d78eb94aeaaf5a3811e34e1c8c1a6e2f8c3f636 (diff)
downloadperl-2f65b2f0bd345fd58390bf7bbb7e2f9c96839f76.tar.gz
Document the fact that keys() and values() are optimized
for void context (as suggested by Liz.) p4raw-id: //depot/perl@21644
-rw-r--r--pod/perlfunc.pod6
1 files changed, 4 insertions, 2 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 4a1b404978..2dbe74057c 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -2325,7 +2325,8 @@ Perl for security reasons (see L<perlsec/"Algorithmic Complexity
Attacks">).
As a side effect, calling keys() resets the HASH's internal iterator,
-see L</each>.
+see L</each>. (In particular, calling keys() in void context resets
+the iterator with no other overhead.)
Here is yet another way to print your environment:
@@ -6297,7 +6298,8 @@ function would produce on the same (unmodified) hash. Since Perl
for security reasons (see L<perlsec/"Algorithmic Complexity Attacks">).
As a side effect, calling values() resets the HASH's internal iterator,
-see L</each>.
+see L</each>. (In particular, calling values() in void context resets
+the iterator with no other overhead.)
Note that the values are not copied, which means modifying them will
modify the contents of the hash: