samix has asked for the wisdom of the Perl Monks concerning the following question:
Hello monks of Perl Knowledge
I am facing a wierd issue with File::Tail, the cpan doc for this module says that It automatically detects and follows the file that are rotated, but I do not see that to be the case. Below is the snippet from my codeuse File::Tail; $file=File::Tail->new("/var/log/maillog"); while (defined($line=$file->read)) { print "$line"; }
After the file is rotated , I find that File::Tail stops reading the new rotated file.
Also it does not end which means that the loop is still active
I have to then kill and restart the script for it to again start reading the new rotated file
Could someone please point out where I may be faltering ?Thanks in Advance
samix
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File::Tail not following rotated files
by almut (Canon) on Jun 01, 2010 at 11:32 UTC | |
by samix (Initiate) on Jun 01, 2010 at 21:23 UTC |