in reply to Re^2: GetOpt Organization (!hash)
in thread GetOpt Organization
"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."
But to be honest, i'm a bit unsure if i guessed right what you mean.
Or in other words: IMHO there is nothing wrong with this idiom:
MAIN: { my %options; GetOptions(\%options, "foo", "bar"); nose ($options{foo}, $options{bar}); } sub nose { my ($foo, $bar) = @_; # stuff my $cuke; }
N.B.: First time post of untested code.
Thank you very much for advice and best regards, Karl
«The Crux of the Biscuit is the Apostrophe»
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: GetOpt Organization (only)
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 |