Hashes are a wonderful thing. They can be used to access
structures in a clean and neat way.
Imagine you have a function that returns an @ARRAY of values,
like localtime or stat. Wouldn't it be nice to
be able to access the elements returned by their name? Here's
how I do it:
my @datekeys = ("seconds","minutes","hour","mday","month","year","wday
+","yday","isdst");
my %localtime;
@localtime{@datekeys} = localtime( time );
printf "It now is %s:%s and the %d day of the week\n"
,$localtime{"hour"}
,$localtime{"minutes"}
,$localtime{"wday"}
;