in reply to Re: How to make an IO::Uncompress::Bunzip2 look like a GLOB
in thread How to make an IO::Uncompress::Bunzip2 look like a GLOB

The statement:

if(UNIVERSAL::can($file,'print')){...}

does not appear to work. I have tried passing it both a string and a GLOB and it never seems to evaluate to true.

Replies are listed 'Best First'.
Re^3: How to make an IO::Uncompress::Bunzip2 look like a GLOB
by Anonymous Monk on Sep 04, 2009 at 04:51 UTC
    Ouch, then  *{$file}{IO}, see *glob{FILEHANDLE}

    Probably the best idea is to simply try to use $file without checking what it is

    $file->print('asdf');