in reply to Re: GetOpt Organization
in thread GetOpt Organization
Whenever I touch Getopt::Long-using code that uses a hash, I usually change it to something that uses variables. In many of those cases, there are actually places in the code using an option name that isn't one of the ones populated by the call. "use strict" prevents such mistakes when variables are used.
I also prefer to reduce the scope of many of the options. Instead of making the hash available "everywhere", I can often make it clearer which options impact the behavior of a particular sub. Or that some option(s) impact nothing other than some small scope.
- tye
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: GetOpt Organization (!hash)
by karlgoethebier (Abbot) on Mar 09, 2015 at 17:55 UTC | |
by tye (Sage) on Mar 09, 2015 at 23:02 UTC | |
by karlgoethebier (Abbot) on Mar 10, 2015 at 11:08 UTC | |
by Anonymous Monk on Mar 10, 2015 at 23:44 UTC | |
Re^3: GetOpt Organization (!hash)
by choroba (Cardinal) on Mar 09, 2015 at 22:31 UTC |