We don't bite newbies here... much | |
PerlMonks |
Re^2: The error says the value is uninitialized, but it works anywayby haukex (Archbishop) |
on Aug 18, 2019 at 07:42 UTC ( [id://11104642]=note: print w/replies, xml ) | Need Help?? |
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 "".
In Section
Seekers of Perl Wisdom
|
|