Re: Searching for a word in a file ....... need a faster way.

2006-07-04 Thread Mr. Shawn H. Corey
Jeff Peng wrote: > Because the latter (grep) is essentially a loop,so grep() is not better > than using 'while(<>)'.Specially,when the file's size is large,reading > all the contents of this file into an array would consume your memory > quickly. > Another way to speed things up is to pre-filter t

RE: Searching for a word in a file ....... need a faster way.

2006-07-04 Thread Jeff Peng
Because the latter (grep) is essentially a loop,so grep() is not better than using 'while(<>)'.Specially,when the file's size is large,reading all the contents of this file into an array would consume your memory quickly. If your /search_pattern/ is changing frequently,I would give another exampl