May 16, 2013, 8:23 AM
Post #8 of 21
The real problem my script needs to resolve is that fact that I am missing events......
Re: [FishMonger] File::Tail Problems
[In reply to]
So, I wrote a script that is monitoring a log file, in real-time, for certain events. If I see that event in the log file, I do something.
The script was working, however I was missing some events. I looked in the log file and saw that the events existed, so I wasn't sure why my script wasn't picking them up. It had to be one of two things:
1. My code to check for the events was wrong.
2. File::Tail was not giving me the events.
In order to check if File::Tail was giving me the events, I took my script and just basically tried to recreate the log file to ensure it was exactly the same. Since it wasn't I determined that for some reasons File::Tail was now printing the characters I see in the log file as non-printable squares. If I figure out why that is happening, I believe my true script will pick up all events.
So I really need to figure out why File::Tail is not printing out the entries as they happen. Is it because of utf-8?
Another interesting finding......
Lets assume I kill the script and it has been running all day long. If I set File::Tail to start from the beginning of the file, the script works perfectly...UNTIL.....I get to the real-time writing. It appears this is when I start getting the non-printable characters.