in reply to Re^4: Using File::DosGlob::glob in loop only works first time
in thread Using File::DosGlob::glob in loop only works first time

The error is the "\" in front of the space in "C:/Program\ Files/". It shouldn't be there.
  • Comment on Re^5: Using File::DosGlob::glob in loop only works first time

Replies are listed 'Best First'.
Re^6: Using File::DosGlob::glob in loop only works first time
by ff (Hermit) on Feb 25, 2006 at 22:59 UTC
    Well, yes, the '\' didn't help, but leaving it blank in the Windows world wasn't helping either; the string wouldn't hang together as a single argument and so I needed to find some kind of glue to submit the file name in toto to the -f test. Perhaps it's overkill, but the current solution of using globbing with a slice does what I want. :-)
      Like I said originally, no glue necessary, just:
      # From DB $template_file = "C:/Program Files/DirDictate/soap_form/soap_final.dot +"; unless ( -f $template_file ) { ... }
      If you got that from the command line, still no glue necessary:
      # Called as: # perl script.pl "C:/Program Files/DirDictate/soap_form/soap_final.d +ot" $template_file = $ARGV[0]; unless ( -f $template_file ) { ... }