Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The file begins reading from the offset but adds an extra line of ,,,,,, It is as if it is reading an extra line which I thought chomp would remove. Any ideas what I am missing?? Thanks.# open the log file open(REGLOG, $regLog) or die "Can't open logfile: $regLog"; #open data file open(REGDATA, ">> $regDataFile") or die "can't open the Registration d +ata file"; # seek to last offset seek(REGLOG, $offset[0], 1); while (<REGLOG>) { chomp; # removing trailing \n # code truncated here for brevity..... # fields defined through delimiters.... print REGDATA "$regDate, $regUserName, $regEmail, $regCountry, $re +gIp, $regRefer, \n"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Using Seek to read and parse growing log files
by cleverett (Friar) on Nov 18, 2003 at 20:54 UTC | |
by Anonymous Monk on Nov 18, 2003 at 21:44 UTC | |
Re: Using Seek to read and parse growing log files
by Roger (Parson) on Nov 18, 2003 at 22:51 UTC | |
Re: Using Seek to read and parse growing log files
by holo (Monk) on Nov 18, 2003 at 20:57 UTC | |
Re: Using Seek to read and parse growing log files
by exussum0 (Vicar) on Nov 18, 2003 at 21:30 UTC | |
Re: Using Seek to read and parse growing log files
by ysth (Canon) on Nov 18, 2003 at 21:07 UTC | |
Re: Using Seek to read and parse growing log files
by talexb (Chancellor) on Nov 19, 2003 at 19:20 UTC |