in reply to String comparison "\x00" vs. "".

Thanks for your explanations, it does make sense to be this way.
I guess visual result got me fooled, also ord() sais they have the same code.
warn ord(''); warn ord("\x00");

Replies are listed 'Best First'.
Re^2: String comparison "\x00" vs. "".
by SuicideJunkie (Vicar) on Jun 14, 2010 at 14:57 UTC

    It might be more sensible for ord to return undef when given the empty string. But if you are using ord on a string that does not contain exactly one character, that probably means you've already missed a step in the logic flow. :)