#!/afs/athena/contrib/perl/p

open(IDX, "/afs/sipb/user/mkgray/olc/sa.index");

for $key (@ARGV){
    while(<IDX>){
	if(/$key/g){
	    $file = substr($_, 0, index($_, ' '));
	    $count{$file}++;
	    while(/$key/g){$count{$file}++;}
	}
    }
}

foreach (sort byvalue keys %count){
    print("$_ with $count{$_} hits\n");
}


sub byvalue { $INST{$b} <=> $INST{$a}; }

