You have a couple mistakes.
my($#ARGV) = @_; makes no sense.
$arg contains a number, so it'll never be equal to any of the strings to which you compare it. You would need to loop over @ARGV.
I'd use Getopt::Long.
use Getopt::Long qw( GetOptions ); sub usage { print STDERR "...simple usage...\n"; exit(1); } sub help { print "...more extensive help...\n"; exit(0); } GetOptions( 'h|?|help' => \&help, ... ) or usage();
You might also find Pod::Usage of interest.
In reply to Re: ARGV issue
by ikegami
in thread ARGV issue
by carbonettis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |