in reply to Re: passing subroutine arguments directly into a hash
in thread passing subroutine arguments directly into a hash
Hah! I finally understood something! Probably something I shd have understood a while ago... namely that a hash in array context is an array. So When I do
§ George Sherston
I get@list = qw (one two three); %args = ( arg1 => 'string', arg2 => 5, arg3 => \@list ); sub1(%args); sub sub1 { print "$_\n" for @_; }
Obvious when you think about it. I mention it here more to fix it in my own mind than in the faint hope of enlightening others, who are probably way ahead of me. But it does make sense for me of a lot of stuff I've been doing on trust, not 100% knowing why it works... like this way of passing arguments to HTML::Template.arg1 string arg2 5 arg3 ARRAY(0x17656b4)
§ George Sherston
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: passing subroutine arguments directly into a hash
by blakem (Monsignor) on Oct 20, 2001 at 16:01 UTC |
In Section
Seekers of Perl Wisdom