I've been trying to figure out how to give help with a -h opt flag and use
the Getopt::Std within the same script.
I've tried several ways to make this happen, and stumbled on an answer.
I've discovered that use Getopt::Std will not allow me to use @ARGV beyond
the point I have typed Getopt::Std in the Perl script. I simply wanted to
get the count of args from @argv and if it was a single arg AND it was '-h'
then give help.
Anyway, the order of items in Perl is really important!!!
use strict -w;
use File::Basename;
use Carp;
use FileHandle;
my $count = @ARGV;
carp "<<<Not enough arguments to get started>>> unless $count > 0;
if ($count = 1 && @ARGV[0] eq "-h") {<.....HELP STUFF....>}
use Getopt::Std;
use constant DIRECTGET => 1;
my %opts = ();
getopt('p:s:u:c:t:f:', \%opts);
I had wanted to keep all the declarations in a section and the subs in a
section and the main script at the bottom, but, I find I must add code in
the declaration section!
Is this normal????
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]