while($string =~/(simple)/g){ my $postition = pos($string); print "most recent match is $1, at position $position\n"; }