use strict;
use warnings;
-use Mouse::Util qw/blessed looks_like_number/;
-use Scalar::Util qw/openhandle/;
+use Mouse::Util qw/blessed looks_like_number openhandle/;
no warnings 'uninitialized';
sub optimized_constraints {
}
: $t
},
+ 'openhandle' => sub {
+ my $fh = shift;
+ my $rt = reftype($fh) || '';
+
+ return defined(fileno($fh)) ? $fh : undef
+ if $rt eq 'IO';
+
+ if (reftype(\$fh) eq 'GLOB') { # handle openhandle(*DATA)
+ $fh = \(my $tmp=$fh);
+ }
+ elsif ($rt ne 'GLOB') {
+ return undef;
+ }
+
+ (tied(*$fh) or defined(fileno($fh)))
+ ? $fh : undef;
+ },
},
'MRO::Compat' => {
'get_linear_isa' => {