in reply to File::DosGlob

Well, I don't know about File::DosGlob in particular, but I know that the builtin glob doesn't work with spaces in the filenames (see perlop). Perhaps it best to just readdir and grep yourself.

opendir DIR, $directory; @duplicate = map { "$directory/$_" } grep { /\.txt$/ } readdir DIR; closedir DIR;

Replies are listed 'Best First'.
Re: Re: File::DosGlob
by myocom (Deacon) on Jan 04, 2001 at 23:37 UTC

    glob seems to work just fine for filenames with spaces on Win2K, at least. In a directory with two long filenames, this one-liner prints them both:

    perl -e "print map(qq($_\n),glob('*.txt'))"

      No, I think the problem is spaces in the wildcards, not in the matches that are returned.

              - tye (but my friends call me "Tye")

        myocom does some experimenting...

        Oh, say, that is broken (er, odd) isn't it...