Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!samsung!uunet!brunix!doorknob.cs.brown.edu!da From: da@stanley.cis.brown.edu (Reindeer) Newsgroups: comp.lang.perl Subject: fgrep()? Message-ID: Date: 27 Jun 91 16:33:30 GMT Sender: news@brunix.UUCP Organization: Brown University CIS, Providence RI USA. Lines: 29 This may be an FAQ, but: Is there an fgrep() for perl? I really like being able to read in a large file in an array (memory is no problem), but doing a grep() on it is really slow, considering I'm looking for pretty boring strings in it. Does anyone have a way to speedup the code below?: (pseudo-perl) @biggie = ; while (!eof(OTHER_BIG_FILE)) { $line = ; @words = split(' ', $line); $keyword = @words[0]; $result = grep(/$keyword/, @biggie); ... } most of the time is spent in the grep line, which is not too surprising but a bit frustrating. both files are several thousand lines long. Also: Is there a way to profile perl programs? Thanks, David Ascher, Perl novice.