in reply to Re: using s/// as map?
in thread how can I speed up this perl??

I'm assuming that the original poster wanted the frequency of all pairs, so we don't want the regex engine to consume more than one character per iteration. With...
$genome="acgt";
Then the look ahead version will finish with...
$count{ac} == 1 $count{cg} == 1 #Note this match $count{gt} == 1
...while the non-lookahead version will have...
$count{ac} == 1 $count{gt} == 1
... i.e. it misses the "cg" case because it jumps through the string two characters at a time.