in reply to Overriding filetest operators via overriding stat()?

A couple of relevant threads:

All of this seems to indicate that what you want is unfortunately not directly possible. One possible solution, although not the most satisfying, is to abstract the test out into a function that can be mocked...

sub check_perms { my $filename = shift; return -f -w -x $filename; } check_perms("filename") or die;