Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question: ⭐ (references)
I create a hash where each element refers to an array:
I can access the individual array elements o.k.:$h{'one'} = [1,2,3];
prints "2" as I expect.print "$h{'one'}[1]\n";
Why can't I access the entire array as if it were a regular array?
What don't I understand here:
doesn't do what I expect.my @a = $h{'one'}; print "$a[1]\n";
Originally posted as a Categorized Question.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How do I refer to an element of a hash of arrays as an array⭐
by arturo (Vicar) on Mar 08, 2001 at 19:17 UTC | |
Re: How do I refer to an element of a hash of arrays as an array
by arhuman (Vicar) on Mar 08, 2001 at 19:17 UTC | |
Re: How do I refer to an element of a hash of arrays as an array
by lachoy (Parson) on Mar 08, 2001 at 23:13 UTC |
Back to
Seekers of Perl Wisdom