Hi,

Here's some (unfinished) code I am trying to use with Getopt::Std, 

#!/usr/local/bin/perl -w
#
use Getopt::Std;
use diagnostics;
getopts('hn:');

&usage if (defined $opt_h);

sub usage { print <<"EOM"
    USAGE: $0 [-h] -n [EMAIL PROTECTED] 

    -h This message
    -n <[EMAIL PROTECTED]>  

EOM


When it's executed, as "test.pl -h" here is what I get in response:

Name "main::opt_h" used only once: possible typo at test.pl line 16 (#1)
    (W once) Typographical errors often show up as unique variable names.
    If you had a good reason for having a unique name, then just mention it
    again somehow to suppress the message.  The our declaration is
    provided for this purpose.
    
        USAGE: test.pl [-h] -n [EMAIL PROTECTED] 

        -h This message
        -n <[EMAIL PROTECTED]>  


The program is functional, but strict settings complain, right?  So what do I
do?  I putting "my $opt_h" to initialize the variable, but then that just
overwrites the setting from the commandline, as you might expect.

What should I do to rid myself of the complaint?  As far as I can tell, It's
used only once, and that's all I need.  So, what am I missing?

Thanks,

deb

PS- I'm on the digest...

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

Reply via email to