Rob Oravec wrote:
> John W. Krahn wrote:
> 
>> I don't understand why you are saying that the append option does not
>> workcorrectly. What exactly are you trying to accomplish?
> 
> The append option works correctly the first time and then continues to
> append to the file every time I run it.
> So in effect I'm getting the same log entries appear in the dump file
> ($date-$ip.log).
> I will want to run the script every (x) seconds and dump each
> router/firewall log to its own log file for further processing, if I
> could get it to check from the last point in the $log_file even better
> but thats for a later mission.

If I understand correctly, you are reading through the whole log file each
time and getting duplicate entries in the "$date-$ip.log" files.

A simple solution is to store the log file size somewhere and if the current
size is greater than the previous size then seek to the previous size or else
start at the beginning.

perldoc -f seek
perldoc -f -s
perldoc -f tell


You could also try caching the "$date-$ip.log" filehandles which may (or may
not) speed up the program.

Let us know if you need any help with that.  :-)


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to