OK, but i don't like this behavior in this special case and the documentation is not clear, that the order of the arguments is important for the result.
Perhaps at least a new hint would be great:
Beware of the order of the arguments (especial when including undef). The result can be different, when the order change.
Am Sa 26. Jul 2014, 17:21:11, TOBYINK schrieb:
Show quoted text> The documentation states:
>
> "Unlike smart match, the behaviour of the match is determined entirely
> by the operand on the right hand side."
>
> And also:
>
> "If the right hand side is undef, then there is only a match if the
> left hand side is also undef."
>
> Which means that match("", undef) will be false, because the left hand
> side isn't undef.
>
> And also:
>
> "If the right hand side is a non-reference, then the match is a simple
> string match."
>
> Which means that match(undef, "") will be true, because the left hand
> side is equal to "" under string equality rules.