Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Reading a file live!by golux (Chaplain) |
on Mar 07, 2014 at 19:38 UTC ( [id://1077447]=note: print w/replies, xml ) | Need Help?? |
Hi negativ_m,
My suggestion would be to assign a variable to the length of the file prior to the first append. Then, just check the filesize; when it grows you know you've got more text to read:
The subroutine read_new_lines() would look something like this:
I use this trick a lot for webpages which need to monitor continuously updating logfiles.
In Section
Seekers of Perl Wisdom
|
|