in reply to Using Seek to read and parse growing log files

First turn on warnings with a "use warnings;" right below the "use strict;" in your program.

I'm willing to be that $regDate, $regUserName, $regEmail, $regCountry, $regIp, $regRefer remain undefined the first time through.

I you find a benign reason for the undefined variables, then just skip printing the line:

next unless defined $regDate;

Otherwise dig through your code to find the reason.

I wonder what would happen if you increment the offset you're seeking on by 1.

seek(REGLOG, $offset[0] + 1, 1);

Replies are listed 'Best First'.
Re: Re: Using Seek to read and parse growing log files
by Anonymous Monk on Nov 18, 2003 at 21:44 UTC
    Yep, that is it, my variable were not defined from the offset although I'm a bit confused why they wouldn't be defined. Anyway, I check for variables being defined before printing them to my datafile and that solves the issue. Thanks to everyone who replied...