Mar 5, 2003, 1:50 AM
Post #2 of 3
The Getopts functions only work on @ARGV because that's where the command line options are held.
Re: [bkreitman] Using GetOpts on something other than @ARGV
[In reply to]
I haven't tried it, but it should be possible to set @ARGV to some other value and then use the functions. You can use "local" and a naked block to prevent @ARGV becoming corrupted.
@ARGV = @some_other_data;
# @ARGV now has its original value.
Dave Cross, Perl Hacker, Trainer and Writer
Get more help at Perl Monks