--- Craig Moynes/Markham/IBM <[EMAIL PROTECTED]> 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]
> 
> Any thoughts on ways to manually parse the parameteres from @ARGV ?

I rolled my own before I knew there were so many out there, and it's a
little shop-specific, but you're welcome to a copy.

In any case, my simple suggestion would be to make them all optional,
then put in a statement to verify the required ones, like

  die "some error message" unless $reqOpt1;

where $reqOpt1 is a variable that MUST be loaded.
Feel free to replace it with whatever syntax gets the option desired....

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

Reply via email to