Based on what you seem to be trying to do in your third while loop (shifting values off of @wkArray), I think you actually want to use hashes instead of arrays.

As it is, your code assumes that the two input files have matching elements in matching order. Do you know that the two files are already sorted in the same way, and actually have matching contents?

It looks like you tried to include sample data in your post. Please edit that to put "code" tags around the data. In fact, you could include an adequate sample of data as part of your posted code, like this:

(start with a <code> tag, of course, or just <c>) # your sample code # goes here… (but please just include what you're actually using) # when it's time to read the sample data in your code, do this: while (<DATA>) { # do stuff with the sample data } # more code… enough to exit cleanly with coherent output… __DATA__ your sample data goes here… (don't forget the closing "code" tag…)
Of course, if there are supposed to be two different input files, I think only one of them can be "faked" with the __DATA__ trick, and you'll need to post a separate "code" block for the other data file.

In reply to Re: Need Help with Maybe a Regex Issue by graff
in thread Need Help with Maybe a Regex Issue by sharkbait

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.