if (defined $arg) { if (ref($arg) and UNIVERSAL::isa($arg, 'IO::Handler')) { $ioref = $arg; } else { eval { --> $ioref = *{$arg}{IO}; }; undef $@; } }