I need to know if there's any possible way to override a file test operator. Specifically, I need to override the -l file test. This is an example:
my $isSymlink = -l "path/to/file";Now, before you answer "why in earth would you even want to do that?", I explain. Perl implementation on Win32 doesn't implement the CORE functions symlink, readlink and file-test "-l", based on the wrong legacy idea of Windows not supporting symlinks. NTFS implements complete symlink functionality although it wasn't very well documented until Windows Vista was released.
I'm trying to run some modules that rely a lot on the symlink Perl functionality and cannot work on Win32 only because of these functions/operator not being implemented.
I already managed to override the CORE functions symlink and readlink in any namespace by the use of a overriding module I created and the use of the special file site/lib/sitecustomize.pl. Both functions work great and return the same result you would expect on unix. But I cannot find a way to do the same to the "-l" file test.
Is there someone here with that depth of knowledge of Perl tricks/secrets? I hope so!
Thanks in advance for any advice. :-)
FranciscoIn reply to How to override a "file test" operator by Zarabozo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |