onegative has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl # # # $LogFile="/usr/local/apache2/eventmgr/ncomount/page.log"; $naptime=3; #Reads LOGFILE continuously open(LOGFILE,"<$LogFile") || die "Couldn't open file Status - $!\n"; for (;;) { for ($logpos = tell(LOGFILE); <LOGFILE>; $logpos = tell(LOGFILE)) { while(<LOGFILE>){ print; } sleep $naptime; seek(LOGFILE, $logpos, 0); # seek to last known } }
20040225 Edit by BazB: Changed title from 'Where did it go???'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Losing first entry of Apache log
by Enlil (Parson) on Feb 25, 2004 at 18:00 UTC | |
by Grygonos (Chaplain) on Feb 25, 2004 at 18:11 UTC |