Couple of problems.

@day_file_args = <FH>;

That there, reads the whole thing. It is pretty rare to have a problem reading from a filehandle. You probably want while (my $line = <FH>){ munge(); } to read one line, process that, then read line two, and process that, so when you get an error you've only read N lines rather than all of them.

($failure = 1)

You're setting failure to 1 instead of testing to see if it is 1? ($failure == 1) is what you want, or simply ($failure) if you only care if it is true or false.


In reply to Re: Line Number Confusion by SuicideJunkie
in thread Line Number Confusion by hmeharward

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.