 more useful options  'Tailing' a File?  by madhatter (Sexton)
on Jan 11, 2001 at 05:07 UTC
( #51044=perlquestion: print w/ replies, xml ) Need Help??  Is
there a way to "tail" a file, grabbing a new "last line" the
second that it is added? I'm on a win32 and would prefer a no
non-standard module solution, if possible.  I know on *nix there
is some -T tag on vi or something similar, but how would this be
done on Win32?   Comment on 'Tailing' a File? (Ovid) Re:
'Tailing' a File? by Ovid (Cardinal) on Jan 11, 2001 at
05:14 UTC     You want something like the following:     while
(1) { while (<FILE>) { # do something here } sleep $for_a_while;
seek( FILE, 0, 1 ); }     The seek above convinces Perl that
you're no longer at the EOF, thus allowing you to continuously
read from your file as new lines are added.      However, the
real problem is: what's wrong with using a module? If it's
reliable and tested, so what?          I used to have to include
the unsavory non-standard module disclaimer before i got perl
and