use strict; use warnings; use Getopt::Long; my $foo; GetOptions ('foo:s', \$foo); if (defined $foo) { $foo = 1 if $foo eq ''; print "foo: $foo\n"; } print "Unprocessed by Getopt::Long\n" if $ARGV[0]; foreach (@ARGV) { print "arg=$_\n"; }
In reply to Re: command line option with- or without argument
by toolic
in thread command line option with- or without argument
by Vasek
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |