blink has asked for the wisdom of the Perl Monks concerning the following question:
how do you test for "no command line options specified" if each key in %option equals 1 by default?use vars qw /%option/; getopt('m:f:l:s:q:h', \%option);
Another related question: I'm trying to say "if you use this option, it needs to accompany another option", and I just realized that what I'm doing doesn't work as expected. Here's what I have:
TIA,if ($option{f}) { die "You must use the -f option along with another option\nRun $0 -h + to view all available options\n" unless (($option{f}) && ($option{l} || $option{m} || $option{d}) +); $ctlFile = "$option{f}"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Boundary conditions with Getopt::Std
by Abigail-II (Bishop) on Jan 30, 2004 at 16:28 UTC | |
|
Re: Boundary conditions with Getopt::Std
by Limbic~Region (Chancellor) on Jan 30, 2004 at 16:25 UTC | |
|
Re: Boundary conditions with Getopt::Std
by duff (Parson) on Jan 30, 2004 at 16:27 UTC |