so i think this is not a perl/syntax bug per se or such..but you're just missing some expected output, which should be a 1 to 1 match for the number of lines on input file.
since you probably cannot provide the production file for us to test with..the crux of the problem will obviously be in identifying exactly which lines are missing in output, and go from there. and to that end you should be able to either rig up something directly in your program or use utilities or such, to find which lines in the input file don't have a corresponding output line.
i once had a curious missing output lines problem myself, during some data migrations for customer supplied data in text files. the perl script didn't see the problem at all, that there were some EOF markers right in the input files, before the end of the files. i confirmed the problem by "cat file | wc" which showed fewer input lines than was purported by data supplier, and used a hex editor to find and delete these early EOF markers. so the moral of it was that you can't assume a text file is a well formed text file, unless you generate it yourself to start with.
the hardest line to type correctly is: stty erase ^H

In reply to Re: input data got lost in foreach loop?! by aquarium
in thread input data got lost in foreach loop?! by FluffyBunny

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.