use Getopt::Std; use Data::Dumper; my $arg_num = scalar @ARGV; #Getting the command-line options my %options = (); getopt( "fdrv", \%options ); if ( exists $options{f} ) { if ( $arg_num != 7 ) { print "USAGE withouf option f\n"; } } if ( not exists $options{f} ) { if ( $arg_num != 5 ) { print "USAGE without option f\n"; } }
In reply to Re: How to use getopt and $#argv together?
by toolic
in thread How to use getopt and $#argv together?
by iphone
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |