in reply to Line Number Confusion

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.

Replies are listed 'Best First'.
Re^2: Line Number Confusion
by hmeharward (Novice) on Oct 01, 2015 at 20:04 UTC

    No, $failure is being set to one for a reason later in the code and it works fine. How do I get the line number from that though? I'm confused. Will:

     my $line = <FH>

    set $line to the current line number? Is there any way to use $. with this?