in reply to Late Logging...

My guess would be that you're Suffering from Buffering, but there may be other problems; your code was a bit long for me to review right now. See How do I post a question effectively? for tips on reducing your code to a minimum.

See File::Tail for an interface specifically geared towards reading files that are appended to.

Replies are listed 'Best First'.
Re^2: Late Logging...
by ali_kerem (Acolyte) on Jul 06, 2013 at 12:44 UTC

    But I didnt know where is the error. That is the reason I posted the whole code.

    Now I fixed it with your help, thank you.