http://www.perlmonks.org?node_id=1017433


in reply to Re: Using grep in a scalar context
in thread Using grep in a scalar context

I'm counting total occurrences of a pattern in the dataset. Input in array format is M H D L N with each element being one letter. Output should count how many times MH, HD, DL, etc. appear. The input is MUCH longer (it's a amino acid sequence). And yes, overlaps are considered. AAA has 2 matches.