in reply to Help taming File::Find
It had never occurred to me that File::Find on a Windows box would return file names with backslashes instead of forward slashes. How gauche.$name =~ s|\\|/|; # substitute forward slash for back slashes, ick +y but don't know a better way.
Anyway, I think a better way to deal with that is:
That's a bit less expensive than a regex substitution (and when you're using File::Find, anything you can do to streamline the "wanted" sub will pay off at runtime); also, the "tr" operator will make sure that all backslashes get converted. (As posted, your code will only convert the first backslash in a given file path name, because you forgot to put the "g" at the end.)$name =~ tr{\\}{/};
|
|---|