Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re3: GetOpt::Long usage style

by dragonchild (Archbishop)
on Apr 08, 2003 at 22:50 UTC ( #249110=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: GetOpt::Long usage style
in thread GetOpt::Long usage style

Personally, I tend to keep thingsl ike synonyms in a data structure of their own. So, I might do something like:

my %options = ( verbose => 0, everything => 1, ); my %synonyms = ( verbose => [ qw( talkative )], everything => [ qw( all )], ); GetOptions( \%options, ( map { join\('|', $_, @{ $synonyms{$_} || []}) } keys %options ), );
This way you can, at a glance, see exactly what your synonyms are, laid out nice as can be. A similar thing can be done with the "=i", "=s", etc.

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.


Comment on Re3: GetOpt::Long usage style
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (12)
As of 2015-07-29 20:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls