Just another Perl shrine | |
PerlMonks |
Meaning of this Filehandle Error?by mmartin (Monk) |
on Oct 22, 2014 at 21:51 UTC ( [id://1104712]=perlquestion: print w/replies, xml ) | Need Help?? |
mmartin has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks, In my most recent script I'm working on I've began deploying Signal handlers and BEGIN and END blocks for the 1st time. I added SIGNAL handlers to my script, along with BEGIN and END blocks, so I could create and remove a PID file for my daemon/script I'm writing, as well as dealing with a few other loose ends... Everything seems to be working great with this. I tried everyway I can think of to end/kill my running script, and everytime it properly creates and subsequently removes the file containing the PID ($$) of my running script. The error I'm wondering about is the error message below. I get the first part, but I'm confused about why there is an error at all...?
Line 58 in my script is this below, which is what makes my END{} block execute when the script is killed/Terminated/etc...
And this is my END code block.
Could that error have anything to do with a file being left open, or something like that, when the END block begins getting executed? Or, is it that I'm using the untie function in that block? I believe at the time that error is displayed, the file tied to the array "@data", had 119 lines in it... So what can I do to get rid of that error/warning? Any thoughts or suggestions would be much appreciated! UPDATE: After I just posted I did a few more tests. Lets say the file 'tied' to @data has exactly 82 lines in it before running my script. I then start my script and immediately I print/push about 10-12 lines onto the end of the file. So at this point my file has 94 lines. I then click Ctrl+C and kill my script. I then get the error: Died at ./myScriptname line 58, <$fh> line 82. I'm confused why it would give an error at line 82, when at the point the script "dies" there are 94 lines in the file...? Thanks in Advance, Matt
Back to
Seekers of Perl Wisdom
|
|