use strict;
use warnings;
-use Mouse::Util 'blessed';
-use Scalar::Util qw/looks_like_number openhandle/;
+use Mouse::Util qw/blessed looks_like_number/;
+use Scalar::Util qw/openhandle/;
no warnings 'uninitialized';
sub optimized_constraints {
: undef;
},
},
+ 'looks_like_number' => sub {
+ local $_ = shift;
+
+ # checks from perlfaq4
+ return 0 if !defined($_) or ref($_);
+ return 1 if (/^[+-]?\d+$/); # is a +/- integer
+ return 1 if (/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/); # a C float
+ return 1 if ($] >= 5.008 and /^(Inf(inity)?|NaN)$/i) or ($] >= 5.006001 and /^Inf$/i);
+
+ 0;
+ },
},
'MRO::Compat' => {
'get_linear_isa' => {