The cause is that the backslash is a special character in regular expressions. This is why you need to use quotemeta on $directory or use \Q...\E when interpolating $directory into your regular expression.
Also, Perl on Windows does not have any problems with using a forward slash instead of a backslash as the directory separator.
$File::Find::dir =~ m|\Q$directory\E\/(.*)|;In reply to Re: A Quirk in File::Find?
by Corion
in thread A Quirk in File::Find?
by Larson2042
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |