in reply to Re: The error says the value is uninitialized, but it works anyway
in thread The error says the value is uninitialized, but it works anyway
undef ne $string if $string is a defined value.
Sorry, but no: $string = "" is a defined value, and undef eq "". What's happening is that eq forces string context on its arguments and undef is converted to "", with a warning, which of course is the same thing as the string "". eq is not a test for definedness, only defined does that - undef eq undef not because they are both undef, but because "" eq "".
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: The error says the value is uninitialized, but it works anyway
by jcb (Parson) on Aug 18, 2019 at 22:30 UTC |