in reply to Use of uninitialized value in string eq

Please note that what you getting is a warning, not an error. Warnings alert you of situations that can lead to possible problems, but they do not terminate your programs like errors do. For eg.

my $string; # $string is declared but not initialized!

so any operation you do on '$string' (except an assignment) will produce the warning message, if you use 'use warnings' or -w option.

check the value of "$moh" variable before comparing.
  • Comment on Re: Use of uninitialized value in string eq

Replies are listed 'Best First'.
Re^2: Use of uninitialized value in string eq
by ikegami (Patriarch) on Oct 23, 2008 at 06:47 UTC

    Please note that what you getting is a warning, not an error

    I've heard this a few times this week and it's just plain wrong. They're not (immediately) fatal errors, but warnings can (and often do) indicate errors. I even say they should be treated as errors until examined, understood, ruled benign and silenced.

    "Please note that what you getting is a warning, not necessarily an error."