I tried preprocessing my $template_file variable with:File check, cannot access C:/Program\ Files/DirDictate/soap_form/soap_ +final.dot, No such file or directory
but that didn't help and so scanning around the ActiveState archives I found:$template_file =~ s#/#\\\\#g;
Now in this case, the glob is being processed in list context, but I didn't think of "context" when I twisted this example for my needs. The file names that I wanted to test would be several absolute path names that wouldn't all have the same directory portion. So, faced with a series of files to check for filedom, I thought that having glob take its crack at creating/passing along the filename would get me its special powers of handling pathnames that include spaces in a Windows world.perl-win32-users Re: using glob with filenames with spaces by Edward G. Orton, Jan 31 2002 7:08AM my @html_files = glob qq{"$input_dir/*.html"}; ego Edward G. Orton, GWN Consultants Inc. Phone: 613-764-3186, Fax: 613-764-1721
It appears that glob is acting like an iterator in which the original call to glob hangs around and gets fired with each visit to the glob line rather than new calls to glob being fired when the line repeats with the loop. I thought that perhaps wrapping an eval around my glob line would do what I wanted, but I'm rather clumsy with that command and the slice/[0] approach works quite nicely. :-)
In reply to Re^4: Using File::DosGlob::glob in loop only works first time
by ff
in thread Using File::DosGlob::glob in loop only works first time
by ff
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |