in reply to Reaped: To find the repeated names and replace them with a increment valu
I just tried a code but it won't work...When I run it loop doesn't end and need the output. could anybody shortout this
Well, you're matching against $xmlin in a loop, and then you try to do substitutions against $xmlin inside that loop -- this is not going to work
This is the loop you want $xmlin =~ s/(<([^>]*)>)/ReplaceOrNot("$1")/sgie;
See perlfaq6, perlrequick for more examples
perlfaq6/How do I efficiently match many regular expressions at once?
perlfaq6/What good is \G in a regular expression?
|
|---|