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


in reply to mapping dynamic fields to options

If you segregate the option processing from the substitution, the following modules can help you do each well:
Getopt::Long and Text::Template.

             "By three methods we may learn wisdom: First, by reflection, which is noblest; Second, by imitation, which is easiest; and third by experience, which is the bitterest."           -Confucius