in reply to Re: Meaning of this Filehandle Error?
in thread Meaning of this Filehandle Error?

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
  • Comment on Re^2: Meaning of this Filehandle Error?

Replies are listed 'Best First'.
Re^3: Meaning of this Filehandle Error?
by dave_the_m (Monsignor) on Oct 23, 2014 at 12:37 UTC
    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