fork(1) download
  1. #!/usr/bin/perl
  2. my $match = qr"some_(\w+)_thing";
  3. my $repl = '"no_$1_stuff"';
  4.  
  5. my $text = "some_strange_thing";
  6. $text =~ s/$match/$repl/ee;
  7. print "Result: $text\n";
Success #stdin #stdout 0s 6044KB
stdin
Standard input is empty
stdout
Result: no_strange_stuff