in reply to Re^3: problem with perl 5
in thread problem with regex in perl script intended for 5.20,but while running on 5.10

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;