in reply to why use a hash instead of an array

are hashes just there for convenience

In a nutshell, yes. Any task that lends itself well to using a hash could be solved using some other method*, but your code would be longer and more difficult to write and maintain. Most Perl programmers strive to do as little work as possible and let the computer take care of the heavy lifting :-)

*) In fact, the CPU doesn't have a clue what a hash is so the problem is actually solved some other way even if you do use a hash

-- FloydATC

Time flies when you don't know what you're doing