On Thu, 17 May 2001, Craig Moynes/Markham/IBM wrote:
> I tried using the getopts, and getopt but I can't seem to have mandatory
> parameters with optional parameters.
> I have something like this for my usage
> perl scp_logs.pl -u username -h hostname -l local_directory [-r
> remote_directory]
Sure you can -- check to see if $opt_u, $opt_h and $opt_l are defined
after you check your command-line options, and if they aren't, print a
usage message. Or, alternatively (and this is good UI design), if a
mandatory command-line option isn't provided, prompt the user for it
interactively.
-- Brett