while ( ( my $index = index $_, $find), $index != -1 ) { substr $_, $index, length $find, $replace; }