in reply to Replacing specified files with actual files using map glob
"perldoc File::Glob" and "perldoc File::DosGlob" both document how to deal with spaces. From File::Glob's documentation:
Since v5.6.0, Perl's CORE::glob() is implemented in terms of bsd_glob(). Note that they don't share the same prototype--CORE::glob() only accepts a single argument. Due to historical reasons, CORE::glob() will also split its argument on whitespace, treating it as multiple patterns, whereas bsd_glob() considers them as one pattern.
so you could use File::Glob qw( bsd_glob ); and replace your calls to glob() with calls to bsd_glob().
From the documentation for File::DosGlob:
Spaces in the argument delimit distinct patterns, so `glob('*.exe *.dll')' globs all filenames that end in `.exe' or `.dll'. If you want to put in literal spaces in the glob pattern, you can escape them with either double quotes, or backslashes. e.g. `glob('c:/"Program Files"/*/*.dll')', or `glob('c:/Program\ Files/*/*.dll')'. The argument is tokenized using `Text::ParseWords::parse_line()', so see the Text::ParseWords manpage for details of the quoting rules used.
- tye
|
|---|