Hi,
> I can't really figure out what the purpose of wantarray() is.
> Can someone please give me a good, decent explanation?
wantarray() returns true if the context of the actual subroutine
expects a list as return value(s).
sub do_something {
my $arg = shift;
do_something and stuff
On Tuesday, Nov 26, 2002, at 06:35 US/Pacific, Mystik Gotan wrote:
I can't really figure out what the purpose of wantarray() is.
Can someone please give me a good, decent explanation?
Thanks in advance :-)
my $scalar = funk(@args);
my @array = funk(@args);
if you use
return wantarray ? @a
Well there is the obvious place to start (perldoc -f wantarray):
wantarray
Returns true if the context of the currently
executing subroutine is looking for a list value.
Returns false if the context is looking for a
scalar. Returns the unde
Mystik Gotan said:
> I can't really figure out what the purpose of wantarray() is.
> Can someone please give me a good, decent explanation?
C is the function which tells you in which context your
subroutine was called - void, scalar or list. This means, what will
happen to the data you return fr
I can't really figure out what the purpose of wantarray() is.
Can someone please give me a good, decent explanation?
Thanks in advance :-)
--
Bob Erinkveld (Webmaster Insane Hosts)
www.insane-hosts.net
MSN: [EMAIL PROTECTED]
___