$_ = "abcdmefg"; while(m/m/g) { print "matched 'm' at ",pos,"\n"; }