reading a growing file in perl

  • How do I read a file which is constantly updating? (Stack Overflow) [link]
  • How can I read from continuously updated file in Perl? (Stack Overflow) [link]
Approaches:
  • File::Tail (or one of its sisters) is your friend (preferred!)
  • use this (together with sleep(…)) for getting EOF reset: seek(LOG, 0, 1) (if you must stay with vanilla perl)
Wrote my 1st script making use of File::Tail today, a “main log file” referring to short other log files. Now I read all of them using File::Tail. Looks good and rather versatile.

Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.