> Understood, but I know that the space within a > directory name must have the \ otherwise it won't work, but > if I try say ( for my testing purposes): > > $MyLoc = "d:/00Common\ Perl/"; > @filelist = glob($MyLoc . "pl0*.pl"); > > The only thing that prints is > d:/00Common > and nothing else. > I also tried: > @filelist = glob("d:/00Common\ Perl/pl0*.pl"); > > It had the same results of D:/00Common >
Interesting, must be a glob() thing ??? > So it may have something to do with how the glob parses > the input passed to it. > > If someone can show us, I would be greatly appreciated > since I thought that I only need escape to make it work. > > Note: I went into File::Glob and it gives the following: > > > 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 I did the following: > > use File::Glob qw(:globally :glob); > > @filelist = bsd_glob("d:/00Common\ Perl/pl0*.pl", > GLOB_QUOTE); foreach ( @filelist ) { > printf "%-s\n", $_; > } > > Now it will work as it should and displays the files as it > should. Itried without the GLBO_QUOTE and it gave the same > results. Just a fyi. > Interesting, I'll have to file that away for later use if need be! > Wags ;) > > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]