use Scalar::Util qw(looks_like_number); sub compare { my ($x, $y) = @_: if (looks_like_number($x) && looks_like_number($y)){ return $x == $y; } else { return $x eq $y; } }
In reply to Re: Exploiting Perls idea of what is a number
by moritz
in thread Exploiting Perls idea of what is a number
by rovf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |