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