Today when munging some data in Perl I came up with a elegant way to use anonymous hashes as lookup tables.
In this case I wanted to translate month names to integers. Of course you could use a bunch of regular expressions to do so. But adhering to the Perl motto there is more than one way to do it I tried using an anonymous hash as a lookup table, like this:
1 2 3 4 5
I quite like this method as no extra variables are needed and you can use this to map many types of data to others.