Not quite, that second = should be a =~, and the shorter (more idiomatic, I'd say) way to write that is:
(my $output = $string) =~ s/\Q$oldstring\E/$newstring/gs;
In reply to Re^4: problem with perl 5
by Anonymous Monk
in thread problem with regex in perl script intended for 5.20,but while running on 5.10
by praveenchappa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |