From: Jesse Luehrs Date: Thu, 21 Apr 2011 06:03:39 +0000 (-0500) Subject: one more fix for unoptimized constraints X-Git-Tag: 2.0100~56 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=188ba42068a975bd2c5df4a471b5341abcee28a4;p=gitmo%2FMoose.git one more fix for unoptimized constraints --- diff --git a/lib/Moose/Util/TypeConstraints/Builtins.pm b/lib/Moose/Util/TypeConstraints/Builtins.pm index 0b28d49..ad6e1f5 100644 --- a/lib/Moose/Util/TypeConstraints/Builtins.pm +++ b/lib/Moose/Util/TypeConstraints/Builtins.pm @@ -102,7 +102,8 @@ sub define_builtins { subtype 'FileHandle' => as 'Ref' => where { - Scalar::Util::openhandle($_) || ( blessed($_) && $_->isa("IO::Handle") ); + (ref($_) eq "GLOB" && Scalar::Util::openhandle($_)) + || (blessed($_) && $_->isa("IO::Handle")); } => inline_as { '(ref(' . $_[1] . ') eq "GLOB" '