c has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; use Getopt::Long; my $in; GetOptions ( 'in=s' => \$in ); if ($#ARGV < 0) { print "you need to put in some command line options!\n"; exit(1); }
however, even when i run ./script --in something the warning is still echoed to the screen. Am i misinterpretting $#ARGV or does getopts::long decrease the value of $#ARGV as it reads in options?
humbly -c
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: using getopts::long and testing for command line options
by ozone (Friar) on Aug 22, 2001 at 18:51 UTC | |
|
Re: using getopts::long and testing for command line options
by idnopheq (Chaplain) on Aug 22, 2001 at 18:50 UTC | |
|
Re: using getopts::long and testing for command line options
by MZSanford (Curate) on Aug 22, 2001 at 18:57 UTC |