in reply to memory monster

Just an idea off the top of my head: if 'crap' is seekable, you could take a two-phased approach-- instead of storing the log entry itself in memory, just store date and the line number. At the end, you'd have a hash of parsed dates and line numbers.

After you'd built this up, you could sort by date, get each line number, seek to the line, parse and print it, and move to the next one. You'd never be storing the contents of the log file entries in memory, so your memory needs should drop a great deal.

Also, I'd investigate the Tie::* modules on CPAN. There are a number of tied hashes which handle disk-based storage.

stephen