http://www.perlmonks.org?node_id=667325


in reply to Stumped UPDATED!?!?!

Use a dispatch table.