Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!unixhub!stanford.edu!unix!Teknowledge.COM!uw-beaver!ubc-cs!alberta!herald.usask.ca!ccu.umanitoba.ca!rahardj From: rahardj@ccu.umanitoba.ca (Budi Rahardjo) Newsgroups: comp.lang.perl Subject: Re: Pattern matching of a large dbm file (slow indexing) Keywords: pattern matching, assoicative array, dbm Message-ID: <1991May7.021455.17320@ccu.umanitoba.ca> Date: 7 May 91 02:14:55 GMT References: <1991May6.163310.21805@ccu.umanitoba.ca> <1991May6.223013.7274@iwarp.intel.com> Followup-To: comp.lang.perl Organization: University of Manitoba, Winnipeg, Canada Lines: 20 Just another perl hacker (Randal L. Schwartz) writes: ...[deleted, read previous posting] ... >You mean, like: >while (($key,$val) = each(%RECORD)) { > if ($key =~ /pattern/) { > "someaction"; > } >} actually it's more like ... if ($val =~ /$pattern/) { ... It's so slow. I am tempted to dump the dbm file into a flatfile (keep 2 files, dbm and flat file), and grep the flatfile. -- budi