in reply to replacing continuesly occuring pattern

Something like this ought to do the trick:

$xml =~ s/<(.*?)name>/<$1names>/g;

[id://CountZero] is right, I misread the original question. I thought the OP simply wanted to replace the "name" tags with "names." Oops.

Replies are listed 'Best First'.
Re^2: replacing continuesly occuring pattern
by CountZero (Bishop) on Apr 16, 2005 at 09:43 UTC
    Are you sure that works? When I tried it I get as a result: <names>abc</names><names>def</names> which is not what was requested.

    CountZero

    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law