my $i = 0; print $i++, "\n" while ( ( $i = index( $text, "ll", $i )) != -1 );