On 9/4/07, sivasakthi <[EMAIL PROTECTED]> wrote: > Hi Guys, > > I have read a log file from backwards, the code is following, > > #!/usr/bin/perl > use strict; > use warnings; > use File::ReadBackwards; > my $bw = File::ReadBackwards->new("/log/path") or die $!; > my $line; > while (defined($line = $bw->readline)) > { > print $line; > } > $bw->close(); > > > In the above file i want to read from backwards until reach a position > that was already processed.. how i can obtain that?? snip
Unless you really need to read it backwards, I would suggest saving the point you stopped processing by calling tell() on the filehandle and saving the number given to you to a config file and then, on the next run of program, reading the number and calling seek() on the filehandle to return that position and resuming processing. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/