On Wednesday, July 17, 2002, at 08:16 , Kevin Old wrote:

> Name "main::opt_C" used only once: possible typo at ./cdma.pl line 42.
[..]
> Use of uninitialized value in numeric eq (==) at ./cdma.pl line 42.
>
> 1) How do I "fix" lines that say "used only once" or possible typo?
> Maybe at this point in my script I'm only going to use that variable
> once, and not use it until 700+ lines into my code....How can I avoid
> seeing these?

The simplest method to 'shut it up' is to do an 'initialization'
of these variables with say

        our ($opt_C, $mar_cdl_format, $daily, $date) = qw/ no no no no/;

The other part of the problem Could be that you have variables that
you ARE only using 'once' and may want to think about WHY you are
doing that to being with,

        my $bob = 'bob';

in itself will cause that 'used only once' error message - but
if you Really do not use $bob, why have It?

If you plan to use it - but have not yet written that chunk of
code - you may want to adopt the 'commenting' strategy:

        # my $bob = 'bob';

on 'the big stack of globals' not yet in use....

[..]

that way when you write the code that Need $bob, it will
of course bark at you about needing it to be defined....


ciao
drieux

---


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

Reply via email to