in reply to search and replace using regular expression

jesuashok how many times do we have to tell you! Always, for every Perl script you write, each time you start writing include:

use strict; use warnings;

For the code fragment that you give Perl reports:

Bareword "old" not allowed while "strict subs" in use at noname.pl lin +e 5. Bareword "g" not allowed while "strict subs" in use at noname.pl line +5. Execution of noname.pl aborted due to compilation errors.

Why do I repeat this when several other people have already said the same thing in this thread? Because you didn't hear and heed the other dozen times you have been told in the past! So, just in case you missed it - always use strictures. Capiche? Comprende? Understand?


DWIM is Perl's answer to Gödel