in reply to A Quirk in File::Find?
my $directory = "\.\\v706_7-17"; # Set directory to search m|$directory\/(.*)| # Variable way that didn't work
So $directory contains the string .\v706_7-17. As a regex pattern, it matches a string that contains any character followed by a vertical whitespace (\v) followed by "706_7-17".
You forgot to convert your literal text into a regex pattern. You can use quotemeta to do this, most easily via \Q\E:
m|\Q$directory\E\/(.*)|
Note that you probably want a ^ at the start of that pattern.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: A Quirk in File::Find?
by Larson2042 (Novice) on Sep 23, 2009 at 21:42 UTC | |
by ikegami (Patriarch) on Sep 23, 2009 at 22:11 UTC |