See Parsing HTML/XML with Regular Expressions for why it's not a good idea to do something like this without modules.
use warnings; use strict; use Mojo::DOM; my $xml = <<'ENDXML'; <foo>3</foo> <foo>14</foo> <foo>159</foo> ENDXML my $dom = Mojo::DOM->new->xml(1)->parse($xml); my $i = 1; $dom->find('foo')->each(sub{ $_->content($i++) }); print $dom->to_string; __END__ <foo>1</foo> <foo>2</foo> <foo>3</foo>
In reply to Re: sequential substitutions
by haukex
in thread sequential substitutions
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |