Oh, my understanding is that when I specify
"output=s"
its a mandatory parameter and if not specified on command line,
GetOptions should return error.
Am i missing something?
Thanks,
Manish
On 09/09/2005 05:56 PM, Chris Devers wrote:
On Fri, 9 Sep 2005, Manish Sapariya wrote:
Shouldn't following snippet throw error message when
it is called without any parameter?
I can't see any error messsage, why?
Because this didn't have an error.
If you want it to quit, force it to quit.
#!/usr/bin/perl
use Getopt::Long;
GetOptions("verbose" => \$verbose,
"debug" => \$debug,
"output=s" => \$output) || print "No inputs specified\n";
die "No output specified" unless defined $output;
print "Executed successfully\n";
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>