penantes has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl $naptime = 20; $telcofile="logilestest"; open (LOGFILE, $telcofile) or die "can't open $telcofile: $!"; for (;;) { for ($curpos = tell(LOGFILE); <LOGFILE>; $curpos = tell(LOGFI +LE)) { print "Got Line!: $_"; } sleep $naptime; seek(LOGFILE, $curpos, 0); # seek to where we had been exit if (stat(LOGFILE))[3] == 0 } close(LOGFILE) or die "can't close $telcofile: $!"; print "Exiting...\n";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Checking multiple files..
by nobull (Friar) on Mar 28, 2005 at 12:35 UTC | |
by penantes (Acolyte) on Mar 28, 2005 at 13:42 UTC |