Help for this page

Select Code to Download


  1. or download this
    substr($s, 1+index $s, 'bar') =~ s/bar/foo/g;
    
  2. or download this
    while ($var =~ s/bar.*?\Kbar/foo/) {1}
    
  3. or download this
    while ($var =~ s/(bar.*?)bar/$1foo/) {1}