Balvinder writes.. >I have a perl script which excepts command line parameters. I am using >getopt function to get the parameters and even if I pass all the >required parameters, the script exits out on the below statement > >if (!getopt('U:D:S:F:M:Hh')) { > die "*** ERROR *** \n $USAGE \n\n"; >} > > >I there anything wrong I'm doing in the above piece of code?? All I >want to do is make sure that the required parameters are passed to the >script. the -M is an optional parameter. I tried removing the : after >the M in the above if statement and that did not changed the behavior. >Any pointers as what am I doing wrong??
This is not documented, but looking at the Getopt::Std.pm code you can see that Getopt::Std::getopt() does not return anything useful. However, Getopt::Std::getopts() does, it returns whether there were any errors or not. In fact that's the main difference between the two functions. -- Jason King _______________________________________________ ActivePerl mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs