in reply to Exploiting Perls idea of what is a number
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; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Exploiting Perls idea of what is a number
by syphilis (Archbishop) on Jul 08, 2008 at 14:00 UTC | |
by rovf (Priest) on Jul 09, 2008 at 06:44 UTC |