This seems like one of those cases where a better understanding of the overall task would really help. Based on the fragments in the OP when I read it, the basic idea seems to be something like this:

On a continuous basis (running constantly):

  1. Check G:/Input to see if there are any files whose names are 1 to 36 characters long and have a ".txt" extension.
  2. For each file detected in step 1, check G:/Output for ... (?)
  3. ?? ... (something involving a particular file (subset) in G:/Output? or something involving the current file from G:/Input if there is no matching file in G:/Output? or something for every pairing of files in the two directories?)

If your overall goal for this app can be described in such terms, there may be much better ways to do this than nested for loops. But I don't know what to suggest, because I don't know what you really want to do.


In reply to Re: Caught in a loop by graff
in thread Caught in a loop by Win

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.