summaryrefslogtreecommitdiff
path: root/pod
diff options
context:
space:
mode:
authorMike Guy <mjtg@cam.ac.uk>2004-12-10 19:08:01 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2004-12-10 22:02:52 +0000
commit20f13e4aa04ece013e593e83cc50c8d459eaa7a7 (patch)
tree6f39ff9feb7cc79c4622637affb70efc01c6e1cc /pod
parentd1888197290ee9e2faa25012d62b59909e6c3e32 (diff)
downloadperl-20f13e4aa04ece013e593e83cc50c8d459eaa7a7.tar.gz
Re: [perl #2562] wantarray fails in END, INIT, and CHECK blocks
Message-ID: <E1Ccq7V-00057s-9s@virgo.cus.cam.ac.uk> p4raw-id: //depot/perl@23639
Diffstat (limited to 'pod')
-rw-r--r--pod/perlfunc.pod6
1 files changed, 5 insertions, 1 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 76fd640e33..dec40d7e6a 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -6731,7 +6731,7 @@ and for other examples.
=item wantarray
Returns true if the context of the currently executing subroutine or
-eval() block is looking for a list value. Returns false if the context is
+C<eval> is looking for a list value. Returns false if the context is
looking for a scalar. Returns the undefined value if the context is
looking for no value (void context).
@@ -6739,6 +6739,10 @@ looking for no value (void context).
my @a = complex_calculation();
return wantarray ? @a : "@a";
+C<wantarray()>'s result is unspecified in the top level of a file,
+in a C<BEGIN>, C<CHECK>, C<INIT> or C<END> block, or in a C<DESTROY>
+method.
+
This function should have been named wantlist() instead.
=item warn LIST