D
Dmitry
OK, so there's a well-known difficulty with handling Windows-style paths in glob: it doesn't
like backslashes, nor does it like spaces. One solution to that is to use Unix-style paths:
glob('C:\Documents and Settings\*'); # Doesn't work
glob('C:/Documents\ and\ Settings/*'); # Works
Problem is, the rest of Perl's built-in file-handling functionality behaves the other way around.
For instance, with -d:
-d 'C:\Documents and Settings'; # Works
-d 'C:/Documents\ and\ Settings'; # Doesn't work
Question: is there any way to use the same path string with glob and with the rest of Perl,
without having to convert them back and forth?
like backslashes, nor does it like spaces. One solution to that is to use Unix-style paths:
glob('C:\Documents and Settings\*'); # Doesn't work
glob('C:/Documents\ and\ Settings/*'); # Works
Problem is, the rest of Perl's built-in file-handling functionality behaves the other way around.
For instance, with -d:
-d 'C:\Documents and Settings'; # Works
-d 'C:/Documents\ and\ Settings'; # Doesn't work
Question: is there any way to use the same path string with glob and with the rest of Perl,
without having to convert them back and forth?