in reply to How come undef eq '' ??

For good reasons operators in Perl do type conversions!

  • ==, + - * and so on do numification so undef is considered 0

  • eq, . and so on do stringification so undef is considered empty string "".

    Anyway using warnings you'll often get "Use of uninitialized value" messages.

    I do not understand what your intentions are, but if you wanna test for undef use the designated functions defined or //

    EDIT

    Equality Operators in perlop

           Binary "==" returns true if the left argument is numerically equal to
           the right argument.
    ...
           Binary "eq" returns true if the left argument is stringwise equal to
           the right argument.
    

    Cheers Rolf