in reply to Function that accepts either a file name or a handle
my $from_a_handle = (ref($from) ? (ref($from) eq 'GLOB' || UNIVERSAL::isa($from, 'GLOB') || UNIVERSAL::isa($from, 'IO::Handle')) : (ref(\$from) eq 'GLOB'));
I'm not sure why both isa 'GLOB' and isa 'IO::Handle' are checked, maybe somewhere there's a package that inherits from IO::Handle, but returns something other than a blessed glob ref (and so would probably have to override most all of the methods)? Or maybe someone was just being redundant :-)
|
|---|