As anticipated above by japhy, there is an evil windows reason at work. I was getting error messages like:

File check, cannot access C:/Program\ Files/DirDictate/soap_form/soap_ +final.dot, No such file or directory
I tried preprocessing my $template_file variable with:

$template_file =~ s#/#\\\\#g;
but that didn't help and so scanning around the ActiveState archives I found:

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
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.

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.