Subject: | read fail on /dev/null |
Date: | Sat, 21 Jun 2008 08:49:05 +1000 |
To: | bug-Config-Tiny [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
With Config::Tiny 2.12 and the debian perl 5.10.0 the program below
prints
'/dev/null' is a directory, not a file
where I hoped the read() call would work on an empty file.
I struck this attempting to pass -profile=/dev/null to perlcritic.
I suspect the -f test in read() is false on a character special file.
(I've generally found "pre-emptive" tests on a filename don't add much.
Let open tell you if it can't open. You can always check after for
ENOENT, EISDIR, etc if the normal error messages for those is too
obscure in the context of the overall action.)
Message body is not shown because sender requested not to inline it.