Spooky has asked for the wisdom of the Perl Monks concerning the following question:

I'm getting "Integer overflow" errors out of my Perl code. The message produces a line number associated with the source code which makes sense but it also refers to a line number from the input file. My problem is the input file being in a binary format - which is really ugly and only made more understandable when I turn "hexl mode" on in emacs. Is there a way to output the input file line the code is choking on?

Replies are listed 'Best First'.
Re: trapping overflows
by keszler (Priest) on Dec 02, 2009 at 14:36 UTC
    $. : Each filehandle in Perl counts the number of lines that have been read from it. (Depending on the value of $/ , Perl's idea of what constitutes a line may not match yours.)
Re: trapping overflows
by JavaFan (Canon) on Dec 02, 2009 at 14:57 UTC
    If your input is a binary file, why are you reading it line-by-line?