Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: mapping dynamic fields to options

by NetWallah (Abbot)
on Oct 22, 2012 at 00:28 UTC ( #1000251=note: print w/ replies, xml ) Need Help??


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


Comment on Re: mapping dynamic fields to options
Re^2: mapping dynamic fields to options
by shads (Novice) on Oct 22, 2012 at 00:48 UTC
    I *could* segregate them which would immediately solve my problem, it just comes at the cost of readability and usability, unless I'm misunderstanding you.

    I feel like just general use of this will be challenging enough without introducing additional (hopefully unnecessary) hardships.
      Apologies for not being clear - what I meant was you could segregate THINKING about the problem, and use both those modules in a single program.

      GetOptions would process the option list, and Template would do the substitution.

      From the looks of your requirements, the program implementing this would be quite small, and completely flexible.

                   "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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1000251]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (2)
As of 2014-09-21 00:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (165 votes), past polls