in reply to why use a hash instead of an array

Your observations about similarities are true!

For instance in JavaScript arrays are (officially) implemented via hashes. =)

BUT there are certain differences in Perl.

These differences in nature lead to different operators, something like push or shift doesn't make much sense for hashes without order. How do you find the highest index/key of an array?

And sometimes, e.g. when dealing with sparse matrices, arrays are simulated via hashes.

HTH

Cheers Rolf

( addicted to the Perl Programming Language)