Re: Question about wantarray()

2002-11-26 Thread Jan Gruber
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

Re: Question about wantarray()

2002-11-26 Thread drieux
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

RE: Question about wantarray()

2002-11-26 Thread wiggins
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

Re: Question about wantarray()

2002-11-26 Thread Paul Johnson
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

Question about wantarray()

2002-11-26 Thread Mystik Gotan
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] ___