Help for this page
while ( ($p = index $haystack, $needle, $p+1) > -1 ) { # e.g. (not tested) pos($haystack) = $p; ... # regex doing the tough dishes ; # /c flag: preserve pos() on non-match }