sub _numberlike { return 1, unless defined $_[0]; # L manpage notes that NaN != NaN, so we can verify that # numeric conversion function works properly along with the # comparison operator. no warnings; return 1 if ((!ref $_[0]) || blessed($_[0])) && eval { ((0+$_[0]) == (0+$_[0])) && (($_[0] <=> $_[0])==0) }; return; }