in reply to Re^2: Parsing logs and bookmarking last line parsed
in thread Parsing logs and bookmarking last line parsed
If you're ok with the idea of recording to a file the last time stamp that was used, it should be pretty simple to record which line you were last on too. You'll just need to modify your while loop a bit by adding a variable to keep track of the line numbers.
For a simple illustration, let's say that you read in from your new assistant file the last time stamp and the last line number read. Let's say that the last line read was stored in the variable $last_line_read. The code below illustrates the modification that you would need to do.
my $line_count = 0; while (my $line = <>){ $line_count++; next if ($line_count <= $last_line_read); # the rest of you code from the while remains the same }
I'm not saying that this is the "best" way to do it, but it should work.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Parsing logs and bookmarking last line parsed
by JaeDre619 (Acolyte) on Aug 21, 2010 at 17:18 UTC |