subtype 'RegexpRef' => as 'Ref' => where { ref($_) eq 'Regexp' };
subtype 'GlobRef' => as 'Ref' => where { ref($_) eq 'GLOB' };
+# NOTE:
+# scalar filehandles are GLOB refs,
+# but a GLOB ref is not always a filehandle
+subtype 'FileHandle' => as 'GlobRef' => where { Scalar::Util::openhandle($_) };
+
# NOTE:
# blessed(qr/.../) returns true,.. how odd
subtype 'Object' => as 'Ref' => where { blessed($_) && blessed($_) ne 'Regexp' };
CodeRef
RegexpRef
GlobRef
+ FileHandle
Object
Role