Chad Perrin wrote:
> On Fri, Apr 14, 2006 at 12:18:33PM -0400, Brian Volk wrote:
>>I'm working through the exercises in the Alpaca book. I don't
>>understand why you have to pass the check_items_for_all subroutine a
>>reference to a hash. Why can't you just pass it the hash itself...
>>check_items_for_all(%all) instead for (\%all) ? Could someone pls
>>explain this to me?
>
> Subroutines take arguments in scalar context.
LIST context.
perldoc perlsub
[snip]
The Perl model for function call and return values is simple: all
functions are passed as parameters one single flat list of scalars, and
^^^^^^^^^^^^^^^^^^^^
all functions likewise return to their caller one single flat list of
scalars.
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>