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 reply to Re^2: How come undef eq '' ??
by muba
in thread How come undef eq '' ??
by tmharish
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |