![]() |
|
Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: How do I refer to an element of a hash of arrays as an arrayby arturo (Vicar) |
on Mar 08, 2001 at 19:17 UTC ( #62966=note: print w/replies, xml ) | Need Help?? |
Since hash values can only be scalars, the value is a reference to an array. That is, it's like a pointer. (Try print "$h{'one'}\n" and see what you get.) To get at the thing the reference points to, you need to explicitly dereference it. To get at the array, do By enclosing something in the @{ } construction, you're saying that you want the array to which that reference points.
In Section
Seekers of Perl Wisdom
|
|