RE: "Use of uninitialized value in string eq at..."

>From the perldiag manpage:

Use of uninitialized value%s
    (W uninitialized) An undefined value was used as if it
    were already defined.  It was interpreted as a "" or a
    0, but maybe it was a mistake.  To suppress this
    warning assign a defined value to your variables.

    To help you figure out what was undefined, perl tells
    you what operation you used the undefined value in.
    Note, however, that perl optimizes your program and
    the operation displayed in the warning may not
    necessarily appear literally in your program.  For
    example, ""that $foo"" is usually optimized into
    ""that " . $foo", and the warning will refer to the
    "concatenation (.)" operator, even though there is no
    "." in your program.

In other words, you tried to read a value from a variable, and you never put
anything in that variable to begin with.

To fix it always initialize variables like this:

my $scalar = ''; # or 0
my @array = ();
my %hash = ();

Rob

-----Original Message-----
From: Steve Few [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 21, 2001 10:52 AM
To: [EMAIL PROTECTED]
Subject: split


I use:

Windows NT(TM)
(C) Copyright 1985-1996 Microsoft Corp.
C:\>perl -v
This is perl, v5.6.1 built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for more detail)
Copyright 1987-2001, Larry Wall
Binary build 629 provided by ActiveState Tool Corp.
http://www.ActiveState.com
Built 12:27:04 Aug 20 2001

-----------
PROBLEM  -  unresolved error messages...

$line= 1,6.944,"methane",29.6576,70617.28,"*BB",8533.32,2381.0883,0.21
I use split (/,/,$line) to send each of the nine elements to an array.

I get these errors or warnings from my KOMODO output. Are the quotes and
'*' causing me problems? I don't know what the message below is warning
me of.

Any insight or help on processing $line above is welcome. I do have
many, and processing time is not an issue. The files are small.
Thanks in advance,  - Steve Few, NC DENR

---------------------

1 6.936 "methane" 18.3294 43860.80 "*BB" 5432.84 2392.9230 0.21
Use of uninitialized value in string eq at
D:\Komodo-1.2\perl\site\lib/perl5db.pl line 1558.
Use of uninitialized value in string eq at
D:\Komodo-1.2\perl\site\lib/perl5db.pl line 1558.
Use of uninitialized value in string eq at
D:\Komodo-1.2\perl\site\lib/perl5db.pl line 1558.
Use of uninitialized value in string eq at
D:\Komodo-1.2\perl\site\lib/perl5db.pl line 1558.
Use of uninitialized value in string eq at
D:\Komodo-1.2\perl\site\lib/perl5db.pl line 1558.
Use of uninitialized value in string eq at
D:\Komodo-1.2\perl\site\lib/perl5db.pl line 1558.
Use of uninitialized value in string eq at
D:\Komodo-1.2\perl\site\lib/perl5db.pl line 1558.
Use of uninitialized value in string eq at
D:\Komodo-1.2\perl\site\lib/perl5db.pl line 1558.
Use of uninitialized value in string eq at
D:\Komodo-1.2\perl\site\lib/perl5db.pl line 1558.
Use of uninitialized value in string eq at
D:\Komodo-1.2\perl\site\lib/perl5db.pl line 1558.
Use of uninitialized value in string eq at
D:\Komodo-1.2\perl\site\lib/perl5db.pl l 2 7.883 "ethane" 2.6984 6601.92
"*BB" 774.63 2446.6188 0.23
 3 9.387 "ethylene" 0.2850 1445.76 "*BB" 202.29 5073.5093 0.28
 4 12.643 "propane" 1.8639 4970.40 "*BB" 488.01 2666.6257 0.37

------------------------------------------------------------------





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

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

Reply via email to