in reply to Design of a global-variable storage package
Obviously, a program has but one @ARGV.
Thus, the data will be global.
sub func { local @ARGV = @_; my( @foo, @bar ); GetOptions( 'foo=s' => \@foo, 'bar=s' => \@bar, ); print "foo = @foo\nbar = @bar\n"; } func( -foo => 1, -bar => 1, -foo => 2, -bar => 2 );
:-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Design of a global-variable storage package
by Tanktalus (Canon) on Nov 23, 2005 at 17:44 UTC |