use IO::File; $filehandle = new IO::File; if ($filehandle->open("; undef $filehandle; }