in reply to position of the last match in RE
$_ = "abcdmefg"; m/m/g; print "Matched 'm' at ", pos, "\n"; [download]