while ($s =~ /aa/g) { print "found aa at $-[0]\n"; }