in reply to Perl Optimization
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)
last; #added to exit inner loop upon match
}
}
}
|
|---|