From: "Jeff Pang" <[EMAIL PROTECTED]>
--- Octavian Rasnita <[EMAIL PROTECTED]> wrote:
Hi,
I am trying to read from a log file which increase
continuously almost every
second.
You may try the Unix 'tail' command and pipe the
result to your Perl program.Like:
tail -f access_log|perl -e
'while(<>){handle_routine()}'
handle_routine() is your routine for handling logfile lines.
I can do this, but in that case I don't know how to be sure that I don't
skip any line of the file.
The condition is to not skip any line and to not get the same line twice.
I tested the tail command in the command line using:
tail -n 1 /path/to/file
because I wanted to get only the last line of the file.
If I use that command for more times, sometimes the same last line is
printed for more times, but sometimes the tail command doesn't print
anything.
I don't know if the result of tail can be trusted...
Thank you.
Octavian
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/