in reply to Re: Whitespace protection in glob expression for Windows network paths
in thread Whitespace protection in glob expression for Windows network paths

Thanks SuicideJunkie for your amazingly quick response. But ... it doesn't work for me. I get the same results as before.

You've prompted me to retry the whole exercise in a cmd window, and lo and behold everything works fine there. It's only when running it from a script that it fails. Very strange.

I've since realised the different results from the script and the interactive session were because the latter was using Strawberry Perl, which doesn't have this problem. Mystery solved. Duh...!

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

Replies are listed 'Best First'.
Re^3: Whitespace protection in glob expression for Windows network paths
by ww (Archbishop) on Nov 11, 2014 at 17:24 UTC
    SuicideJunkie's reply Re: Whitespace protection in glob expression for Windows network paths "works" (on a local or mapped drive) with Win7, AS 5.018 ...

              ... as a script:

    #!/usr/bin/perl use warnings; use strict; use 5.018; # 1106821 my @dir = @ARGV; for my $dir(@dir) { print glob "\"$dir/*\"\n"; }

              ... and as a one-liner at the cmd prompt:

    C:\>perl -E "my $dir = \"d:\_wo\"; print glob \"$dir/*\";

    where "works" is not deprecated as a descriptor because of its failure to terminate each item with a return, tab or other spacer... but that's an issue rooted in this usage of glob.

    You're apt to learn something valuable if you'll do the necessary work to trace down and understand what went wrong with your attempt to implement the first reply.


    ++$anecdote ne $data


      Thanks ww. My Active State version of Perl is 5.10.1. Unfortunately I'm stuck there owing to company policy. (Yes, we've still got one machine running Windows 98.) I think the Perl version could be at the root of the problem I was having. I was wrong when I said I also had this problem in Strawberry Perl: that's at a later version (5.18.2) and it doesn't exhibit this problem.