From perlop
Binary "<=>" returns -1, 0, or 1, depending on whether the argument on the left is numerically smaller, equal to, or greater than the right argument. If your platform supports NaN (non-digits) as numeric values, using them with "<=>" returns undef. NaN is not "<", "==", ">", "<=" or "> =" nothing (even NaN), so these 5 return false. NaN = = NaN returns true, like NaN! = Something else.
If your platform does not support NaN, then NaN is just a string with a numeric value of 0.
NaN behaves differently on different platforms. It is in a sense numerical, since it can act as such in numerical operations. But this is also really not a number, because it has the value undefined.
In addition, his behavior is not tolerated as:
perl -E "say 'yes' if 0 == 'NaN'"
may produce different results on different platforms if you are not using Perl 5.22 or later.
source share