fork(6) download
  1. #!/usr/bin/perl
  2.  
  3. $str = 'banana';
  4. $foo = 'na';
  5. #$str =~ s{/$foo/ge} s{/./-/g}e;
  6. $str =~ s/$foo/$&=~s#.#-#gr/ge;
  7. #$str =~ s/($foo)/$1=s|.|-|rg/egi;
  8. print $str;
Success #stdin #stdout 0s 6056KB
stdin
Standard input is empty
stdout
ba----