>>From: Bob Showalter
>> From: Postman Pat 
>> 
>> Greetings,
>> I am trying to do command line processing using the above 
>> lib, but am not 
>> quite getting the syntax from the PLEAC perl project. For 
>> instance I have 
>> the following args allowed:
>> -s x.x.x.x | server.domain.com > server is ip/host
>> -o outfile > output to outfile
>> -h > display help.
>> 
>> I understand how to do the help option but not the top two 
>> that require an additional arg.

Which method are you using?

>> ie I call "dowhatever.pl -s 192.168.1.1 -o didthis.txt"
>> 
>> How would I go about getting this working?
>
>I don't know what the PLEAC perl project is, but the documentation
>for Getopt::Std is real clear on how to do this. What is the
>specific problem you're having?

I disagree.  Getopt::Std is not clear.  Then again, it may be all 
modules where the documentation is not clear to an experienced 
programmer learning perl, since the other few modules I've looked
at (Getopt::Long,XML::Parser) weren't clear to me either.  Until
I used the try a bunch of things and figure out what works method.

>   use Getopt::Std;
>   our ($opt_o, $opt_s, $opt_h);
>   getopts(o:s:h) or exit 1;
>   print "Output to $opt_o\n" if defined $opt_o;
>   print "Server is $opt_s\n" if defined $opt_s;
>   print "You want help\n" if $opt_h;

use Getopt::Std;
my %opthash = ();
getopt('osh',\%opthash);
print "Output to $opthash{o}\n" if defined $opthash{o};
print "Server is $opthash{s}\n" if defined $opthash{s};
print "You want help\n" if exists $opthash{h};


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to