Sam Tregar wrote:
On Fri, 30 Jul 2004, Sébastien Aperghis-Tramoni wrote:
perlfunc recommends to C<use filetest 'access';> for better results when
running on a filesystem with ACL support. The filetest pragma seems to be
available since Perl 5.6.
Is it lexical, or could a user use the pragma in their code and fix HTML::Template's file tests?
According to the doc, this pragma is lexical.
But IIRC, the Cookbook recommended to forget all the -X tests (where X =~
/[rwxo]/i) and simply open() the file then test after the error code.
In fact, this remark is in the doc of the filetest pragma.
I think I'd take a patch in that direction, provided it produced the same quality of error checking.
Looking at the code, it seems it's even simpler that this: it's just that you used -r to test if a file if still present on the filesystem instead of -f or -e.
Attached is the patch against version 2.7 to correct that.
filetest.patch
Description: Binary data
Sébastien Aperghis-Tramoni -- - --- -- - -- - --- -- - --- -- - --[ http://maddingue.org ] Close the world, txEn eht nepO