$my_hash{'my_key'} = [@my_array];
# Turns out to be the correct way to put an array into
# a hash value.
The brackets are creating an anonymous array, or rather it's creating an anonymous array with the values from @my_array and returning a reference to it.
The reason \@my_array doesn't really work the way you want is that you would be repeatedly taking a ref to the SAME array over and over which is generally not what you want.
All arrays and hashes can only hold scalar values so the only way to build more complex structures is with references. When you say a hash of arrays, we're really talking about a hash of array references. That's the reason you get "ARRAY(0x35fd724)" when you try and print out a ref to an array. It's not an array. It's a reference.
Now why isn't perl smart enough to let you say the following?
push ($HoA{key},@values)
It has to do with parsing. What exactly is in $HoA{key} isn't known at compile time. It won't be determined til runtime and even then it could change at any given moment.
Another parsing reason is context.
For example:
push (@vals, $HoA{key}, @list);
What context do you want $HoA{key} to be used in? Perl couldn't possible figure that out. The syntax can be daunting at first, (especially on Hashes of Arrays of Hashes...) Hope this helps.
-Lee
"To be civilized is to deny one's nature."