madhatter has asked for the wisdom of the Perl Monks concerning the following question:
while(1){ while(<FILE>){ print $_; seek(FILE,0,1); } sleep(1); }
It'll print out the entire file, then start printing the last line as it is written. Ideally, this would:
A - Ignore everything except lines that are added after the program is run .. or
B - Print the last line of the file, then do its thing printing new lines.
I've tried all sorts of seeks() all over the code, to no avail. Any help would be greatly appreciated.
Thanks,
madhatter
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Skipping to the End of a File
by moen (Hermit) on Jan 14, 2001 at 22:45 UTC | |
|
Re: Skipping to the End of a File
by chipmunk (Parson) on Jan 15, 2001 at 09:05 UTC | |
|
Re: Skipping to the End of a File
by BatGnat (Scribe) on Jan 15, 2001 at 09:25 UTC | |
by danger (Priest) on Jan 15, 2001 at 09:43 UTC |