Re: Tie::File surprise (to me)
- From: Uri Guttman <uri@xxxxxxxxxxxxxxx>
- Date: Tue, 27 Mar 2007 15:39:52 -0500
"b" == boyd <tbmoore9@xxxxxxxxxxx> writes:
b> I probably should have known this, but didn't. In Tie::File, where you
b> tie an array to a long file, and you want to read backwards from the end
b> of it ( to look for the most recent lines, for example, in a log file),
b> it is much faster to address the lines with $index as a negative number,
b> meaning to search from the end of the array. It takes a while for the
b> module to find the index = -1, but the subsequent searches on -2, -3,
b> etc. are much faster than using @#array-1, @#array-2, etc.
you should use File::ReadBackwards for that. much faster than tying a
log file.
uri
--
Uri Guttman ------ uri@xxxxxxxxxxxxxxx -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
.
- Follow-Ups:
- Re: Tie::File surprise (to me)
- From: boyd
- Re: Tie::File surprise (to me)
- References:
- Tie::File surprise (to me)
- From: boyd
- Tie::File surprise (to me)
- Prev by Date: win32 modules
- Next by Date: Re: win32 modules
- Previous by thread: Re: Tie::File surprise (to me)
- Next by thread: Re: Tie::File surprise (to me)
- Index(es):
Relevant Pages
|
|