Chivalri has asked for the wisdom of the Perl Monks concerning the following question:
#%hash has been filled with some meta data in an array read in #from the smaller flat file #The first element is the name we are searching for. #the rest are irrelevant to this loop # #fh_log is a file handle to the large 300mb+ flat file #each line may contain references to 1 or more table names, and #I need to capture all of them. while($cur_line=<fh_log>) { foreach $key (keys %hash) { $table = $hash{$key}[0]; #If this query contains reference to this table if($cur_line=~ m/$table/i) { #count up how many times this table is referenced. $table_stats{$table}++; $table_refs++; #total table references (for % calc) } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl Optimization
by BrowserUk (Patriarch) on Aug 09, 2008 at 00:45 UTC | |
by Chivalri (Initiate) on Aug 11, 2008 at 20:26 UTC | |
|
Re: Perl Optimization
by ikegami (Patriarch) on Aug 09, 2008 at 00:22 UTC | |
|
Re: Perl Optimization
by GrandFather (Saint) on Aug 09, 2008 at 00:09 UTC | |
by ikegami (Patriarch) on Aug 09, 2008 at 00:29 UTC | |
|
Re: Perl Optimization
by jmcada (Acolyte) on Aug 09, 2008 at 00:24 UTC | |
|
Re: Perl Optimization
by jethro (Monsignor) on Aug 09, 2008 at 00:29 UTC |