in reply to Re^2: FASTA riddle.
in thread FASTA riddle.

Alternatively, Is it possible to look at the values of a hash and find out how many times my search string is present?
#input = $search foreach my $key (keys %hash) { $searchline = $hash{$key}; if ($searchline =~ /$search/gi) { $contains ++; } }
Because this seems also to stop counting once it finds the FIRST $search, making the resulting "$contains" merely equal to the number of values that happen to contain at least one of the $search strings....