in reply to if -s clause on a FILEHANDLE

Close the file before asking it's properties.

pelagic

Replies are listed 'Best First'.
Re^2: if -s clause on a FILEHANDLE
by Fletch (Bishop) on Jun 08, 2004 at 14:47 UTC

    You don't have to close it, but you do need to make sure that any writes that you want considered have been flushed (either by setting $|, calling $fh->flush, or closing it if you really are done).</pedant>