http://www.perlmonks.org?node_id=927542


in reply to Re: Check for an empty file
in thread Check for an empty file

I had some trouble with this a while back. -s returns a zero if the file is either zero bytes or nonexistent. It got a bit confusing until I worked out what was happening.

Replies are listed 'Best First'.
Re^3: Check for an empty file
by ikegami (Patriarch) on Sep 23, 2011 at 16:35 UTC

    Actually, it returns undef (and sets $!) if the file is non-existent.