To get more specific help, you should update your post with a small sample of your input files (a few lines each), your actual output and your expected output.

Probably unrelated to your problem... if you are interested in using a more robust (and modern) Perl coding style, run your code through perlcritic. Here are a few of the issues:

'Bareword file handle opened at line 37, column 2. See pages 202,204 +of PBP. (Severity: 5)', 'Two-argument "open" used at line 37, column 2. See page 207 of PBP. + (Severity: 5)', 'Close filehandles as soon as possible after opening them at line 37, +column 2. See page 209 of PBP. (Severity: 4)', '"$nm" is declared but not used at line 27, column 1. Unused variable +s clutter code and make it harder to read. (Severity: 3)', 'Mismatched operator at line 53, column 21. Numeric/string operators +and operands should match. (Severity: 3)',

In reply to Re: Finding missing record between 2 files ? by toolic
in thread Findding missing record between 2 files ? by bh_perl

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.