http://qs1969.pair.com?node_id=1142665


in reply to how do you use the index function on this example?

Ah, never mind, I found this solution:
while($string=~/(M+)/g) { ($start, $end) = ($-[0], $+[0]); print $start."\t".$end."\n"; }

Thanks