I often do complex file/directory/symlink tests, and am writing a subroutine to do so.
for example, instead of
if (-x $file)
write
my $test = '-x';
if ($x $file)
and I can vary $x to be -f -r -e or whatever.
I have read the file testing documentation thoroughly, https://perldoc.perl.org/functions/-X
and there doesn't appear to be any trick so that this can be done.
I've read File::Find https://perldoc.perl.org/File::Find but I don't want to write a separate subroutine every time I do a search, which would make the code very ugly and long.
Is there anything or any trick that I've missed?