in reply to 'Tailing' a File?
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.while (1) { while (<FILE>) { # do something here } sleep $for_a_while; seek( FILE, 0, 1 ); }
However, the real problem is: what's wrong with using a module? If it's reliable and tested, so what?
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (Ovid) Re: 'Tailing' a File?
by epoptai (Curate) on Jan 12, 2001 at 03:14 UTC |