|laziness, impatience, and hubris|
Re: globing files with spaces problem.by kschwab (Priest)
|on Aug 10, 2002 at 15:26 UTC||Need Help??|
Short Answer: use File::Glob's bsd_glob instead of CORE::glob.
I get the same problem. At first, it appears to be a bug. Supposing the following directory tree:
And the following code:
I get back 'dir' and 'dir1/file1'. Strangely enough, if I use File::Glob's bsd_glob, it works just fine:
So, I looked at the docs and found that it's working as documented :)
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 pat tern.