|The stupid question is the question not asked|
Re: Re: GetOpt::Long usage styleby demerphq (Chancellor)
|on Mar 08, 2003 at 19:58 UTC||Need Help??|
Yeah I do use this style as well. However it still presents duplication when you want to provide defaults or multiple names or types for options (which rules out a quick key %opts), in fact its worse because you dont have compile time var name checking of the var names if they get out of synch. In other words the connection between destination and source becomes too loose and it becomes really easy to make a subtle error
So what happens if we werent careful and do it like
Oops, now the --all options goes to the wrong place.
Anyway, I still would use the %hash style as well for some situations, and as the interface to Getopt::Long is so flexible you can mix the two:
And then theres also using subs for the options... Mmm fun!