Hi, I'm having trouble with this code:
while ($data =~ s/<tag>/<tag id="$id">/g) {
$id++;
}
the problem is that the updated $id doesn't get substituted in the loop, although the variable does get updated. I thought that so long as you don't use the o qualifier, the regex will recompile every time it's run. How can I get around this? Thansk in advance for your help.
Dom
while ($data =~ s/<tag>/<tag id="$id">/g) {
$id++;
}
the problem is that the updated $id doesn't get substituted in the loop, although the variable does get updated. I thought that so long as you don't use the o qualifier, the regex will recompile every time it's run. How can I get around this? Thansk in advance for your help.
Dom