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;
In reply to Re: Overriding filetest operators via overriding stat()?
by haukex
in thread Overriding filetest operators via overriding stat()?
by perlancar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |