in reply to How do I tail -f a file if it is NFS mounted?

I've used this technique before with quite a bit of success. Only problem is that it can't detect a "real" EOF (writer has stopped writing to the file) but that will be the case with just about any method:
#!/usr/bin/perl -w use IO::File; use strict; my $tail = new IO::File; $tail->open("<./log.dat"); while(1){ my @lines=$tail->getlines(); if(0==scalar(@lines)){ # wait 1 second before trying again... # to keep from hogging CPU cycles sleep 1; }else{ my $line; foreach $line(@lines){ chomp $line; print " \"$line\"\n"; } } }