|
|
| Perl-Sensitive Sunglasses | |
| PerlMonks |
Re^2: How come undef eq '' ??by muba (Curate) |
| on Jan 30, 2013 at 15:55 UTC ( #1016092=note: print w/ replies, xml ) | Need Help?? |
|
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
|
|
||||||||||||||||||||