in reply to Using Search::Dict on log files

Some resources on Search::Dict: tests, MacPerl thread, mentioned in an article.

Some more related resources: Re: Binary searching with Perl., Binary Searches on Sorted Text Files that pointed me to File::SortedSeek (version 0.012 and below suffers from bug RT#36160).

Watch out of the bug above (use version 0.013 or above). Using File::SortedSeek:
perl -e 'use File::SortedSeek qw{:all};use Date::Manip;my $file=shift; +my $sdate=shift;sub get_date{my($d) = $_[0]=~/\[(.*)\]/;return ParseD +ate($d);};open BIG,$file;alphabetic(*BIG,$sdate,\&get_date);while(my +$l=<BIG>){if(get_date($l)=~m/$sdate/){print $l}else{last}}' /var/log/ +httpd/access_log 2008052100:05:05
YAR! Mark Jason Dominus' slides from a now free class: lightweight-db slide 22, licensed under a Creative Commons Attribution-Noncommercial-ShareAlike 3.0 License.