Help for this page

Select Code to Download


  1. or download this
    while ( ( my $index = index substr( $_, pos() ), $find),
              $index != -1 )
    {
        substr $_, $index, length $find, $replace;
        pos() = $index + length $find;
    }
    
  2. or download this
    while ( ( my $index = index $_, $find),
              $index != -1 )
    {
        substr $_, $index, length $find, $replace;
    }