in reply to Substitute problem

Uhm... the line you gave will work. I expect you are inadvertently running it on a single page more than once. You could modify the regex to prepend the "_n" only if those two chars aren't already "_n" by using a negative look-behind assertion:

s/(?<!_n)\@mail.ab.com/_n\@mail.ab.com/gi;

-sauoq
"My two cents aren't worth a dime.";

Replies are listed 'Best First'.
Re: Re: Substitute problem
by Anonymous Monk on Jul 30, 2003 at 21:10 UTC
    Thanks, I am running it in 1000's of files using File::Find.
      If you got multiple "_n" appendages in one run, this might have happened because File::Find was somehow following "links" (in unix, there are "symbolic links" and "hard links"; I think the comparable notion in MS-Windows is called "shortcuts") -- i.e. shortcuts/links may exist in your directory structure, such that there is more than one path to a single data file or directory, and File::Find would pursue all of them, and hit on some (sets of) files more than once.