Thank you all (Laurent R, perlfan, Tanktalus) for your ideas! Tanktalus, I think you misunderstood my arrays' schema, but no matter: I think I will end up using something based directly on one of your ideas:

while(@array1 or @array2) { while(@array2) { my $item = shift @array2; # Do various things } if(@array1) { my $item = shift @array1; # Do various things } }

This avoids the need for me to learn to use threads or Coro. And (it's especially good for me at this juncture. My script has (as I mentioned) been running for days, building up `@array2` without doing anything with it really, but I stored the array elements in a file, so now I can read that file and start acting on it immediately. Even after my current list of `@array2` items is exhausted,) I'm more interested really in `@array2` items than in `@array1` items, so this is a good solution for me. Thanks again.

$_="msh210";$"=$\;@_=@{[split//,uc]}[2,0];$_="@_$\1";$\=$/;++$_[0]for$...1;print lc substr crypt($_,"@_"),1,6

In reply to Re: Switching back and forth between parts of my script by msh210
in thread Switching back and forth between parts of my script by msh210

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.