in reply to Re: How come undef eq '' ??
in thread How come undef eq '' ??
Because eq is for string comparisons. undef stringifies to "", 0 stringifies to "0", and "" ne "0".
Change eq to == and it will print "In".
In Section
Seekers of Perl Wisdom
in reply to Re: How come undef eq '' ??
in thread How come undef eq '' ??
Because eq is for string comparisons. undef stringifies to "", 0 stringifies to "0", and "" ne "0".
Change eq to == and it will print "In".