Re: Tie::File surprise (to me)
- From: boyd <tbmoore9@xxxxxxxxxxx>
- Date: Thu, 29 Mar 2007 13:17:31 GMT
In article <x7r6rao1yf.fsf@xxxxxxxxxxxxxxxx>,
Uri Guttman <uri@xxxxxxxxxxxxxxx> wrote:
"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
Thanks, uri. I didn't know about File::ReadBackwards.
Boyd
.
- References:
- Tie::File surprise (to me)
- From: boyd
- Re: Tie::File surprise (to me)
- From: Uri Guttman
- Tie::File surprise (to me)
- Prev by Date: Log4perl module for cygwin newbie
- Next by Date: Re: Log4perl module for cygwin newbie
- Previous by thread: Re: Tie::File surprise (to me)
- Next by thread: win32 modules
- Index(es):
Relevant Pages
|
|