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
ref=eval "sub { $eval }";
die "can't eval: $@" if $@;
return $ref;
}
Here @init strore the conditions of /search_pattern/.
From: "kilaru rajeev" <[EMAIL PROTECTED]>
To: beginners@perl.org
Subject: Searching for a word in a file ... need a fas
Hi all,
I'm searching for a word in a file. I wrote the code like this.
while ( ) {
if ( /search_pattern/ ) {
executebale.
}
}
or
Can I use like,
@list = ;
grep();# using grep on list
Let me know a faster way to search.
Regards,
Rajeev