Change 23639 by [EMAIL PROTECTED] on 2004/12/10 22:02:52
Subject: [PATCH] Re: [perl #2562] wantarray fails in END, INIT, and
CHECK blocks
From: [EMAIL PROTECTED] (Mike Guy)
Date: Fri, 10 Dec 2004 19:08:01 +0000
Message-ID: <[EMAIL PROTECTED]>
Affected files ...
... //depot/perl/pod/perlfunc.pod#450 edit
Differences ...
==== //depot/perl/pod/perlfunc.pod#450 (text) ====
Index: perl/pod/perlfunc.pod
--- perl/pod/perlfunc.pod#449~23637~ Fri Dec 10 02:17:47 2004
+++ perl/pod/perlfunc.pod Fri Dec 10 14:02:52 2004
@@ -6731,13 +6731,17 @@
=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).
return unless defined wantarray; # don't bother doing more
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.
End of Patch.