in reply to Meaning of this Filehandle Error?

Its like English :) left to right, left to right, commas seperate :)

So  Died at ./myScriptname line 58, <$fh> line 82.

Its like

Died at ./myScriptname line 58, <$fh> line 82.

Its like

Died at program ./myScriptname while execu line 58 of program, the filehandle <$fh> was open to line 82 when program died.

Replies are listed 'Best First'.
Re^2: Meaning of this Filehandle Error?
by mmartin (Monk) on Oct 22, 2014 at 22:17 UTC
    Hey AM, thanks for the quick reply!

    Ok, so is it more of just a warning then, that the file was open and this was the last line number in the file?

    I'm guessing I get that error/warning because I am issuing the untie command to close the log file after the
    die command is being run..? Does that sound right?

    Thanks again for the reply, much appreciated!

    Thanks,
    Matt
      The 'die' command, when presented with an argument not terminated with a newline, appends the location where 'die' was called, along the currently selected filehandle, and the current line number of that file, where available. The tieing is irrelevant; '<$fh> line 119' means that $fh is the currently selected filehandle, and 119 is the last line that was read from that file (it should match $.). 119 does not indicate the number of lines in the file.

      Dave.

        Hey Dave, thanks for the reply.

        Ok, that makes sense then. I was wondering because I do certain things in the script like splicing out some lines from that
        file and stuff like that so a few times it would say something like "<$fh> line 101", but when I'd check the file there
        would only be 80 or something less then what it reported... So that makes a little more sense now.

        Do you think I should use something other then "die" there? Maybe just "exit", or something like that?

        Thanks again for the explanation, much appreciated!

        Thanks Again,
        Matt