in reply to Whitespace protection in glob expression for Windows network paths

Does bsd_glob do any better? see File::Glob -- it doesn't split patterns on spaces, so might just give you a better result.

The help for glob suggests a different syntax for passing variables, so you might try that too.

  • Comment on Re: Whitespace protection in glob expression for Windows network paths

Replies are listed 'Best First'.
Re^2: Whitespace protection in glob expression for Windows network paths
by Another Ed (Sexton) on Nov 11, 2014 at 15:39 UTC

    Thanks RichardK for another good suggestion. I've tried this, and it also seems to do the trick nicely: minimal changes to existing code, and I can dispense with the nested quotes. The only funny was that the File::Glob in my Strawberry Perl doesn't seem to export bsd_glob, so I had to call it by its fully qualified name, but that's no hardship. The only funny is that in the version of File::Glob in Active State Perl 5.10.1, the :bsd_glob export tag isn't recognised, but the function itself is still exported: use File::Glob 'bsd_glob';.

    I see the manual page for File::Glob refers also to File::DosGlob, but I was a little too put off by the latter's manual page to take that idea any further.

Re^2: Whitespace protection in glob expression for Windows network paths
by Another Ed (Sexton) on Nov 11, 2014 at 15:42 UTC
    By the way, the "help for glob" to which you refer was what I was following when I first started to code this, and that's what led me into this fine mess.