+1. I compiled Perl 5.20.0 with -uselongdouble and Data::Validate cannot be installed. This is probably a fairly common option to use in newer perl on 64 bit systems.
** testing is_even...
1: 0 is even
1: ok 1
2: 2 is even
2: ok 2
3: 1 is odd
3: ok 3
4: 5 is odd
4: ok 4
5: 0.1 is not an integer
5: not ok 5
6: 'foo' is not an integer
6: ok 6
7: 0 is even (object)
7: ok 7
8: 1 is odd (object)
8: ok 8
# END
This seems to do the trick:
--- Validate.pm.orig 2014-07-25 12:23:53.000000000 -0700
+++ Validate.pm 2014-07-25 12:26:38.000000000 -0700
@@ -9,6 +9,7 @@
use POSIX;
use Scalar::Util qw(looks_like_number);
use Math::BigInt;
+use Config;
@ISA = qw(Exporter);
@@ -177,7 +178,7 @@
# can do this for us, but defeats the purpose of being
# lightweight. So, we're going to try a huristic method to choose
# how to test for integernesss
- if(length($int) > 10){
+ if (!$Config{uselongdouble} && length($int) > 10) {
my $i = Math::BigInt->new($value);
return unless $i->is_int();