[sf-perl] Return from a function

David Scott ds94103 at earthlink.net
Thu Feb 28 11:24:28 PST 2008


It just does.  It's part of Perl.  Functions can return in either scalar 
or list context.  The place to look for an answer is in just about any 
Perl book.

Also, you don't need the & to call a function (at least, not in Perl 5, 
which came out about 12 years ago).

d

nheller at silcon.com wrote:
> I have an idea in my head that's obviously incorrect.
> Maybe its a mental block but I can't even think of where to look for an
> answer.  If the answer is obvious could y'all just say it but I would
> appreciate getting a keyword or referrence topic for my use later.
>
> [question]
>
> I was always under the assumption that Perl (like C) returns a single
> value from a function.  I seems like this is not true as it looks like the
> following function returns 3 values.  How could this be?
>
> my ($a, $b, $c);
> my ($paramA, $paramB);
>
> ($a, $b, $c0 = &someFunc($paramA, $paramB);
>
> [/question]
>
> _______________________________________________
> SanFrancisco-pm mailing list
> SanFrancisco-pm at pm.org
> http://mail.pm.org/mailman/listinfo/sanfrancisco-pm
>
>
>   




More information about the SanFrancisco-pm mailing list