in reply to Re: sequential substitutions
in thread sequential substitutions

Sorry, but there are at least two things wrong with that code (aside from using regexes to parse HTML...): It does not re-number the entries as the OP specified, and sort @la; does nothing (should be @la = sort @la; instead, warnings would have told you about this). So really the only effect of this code is to remove any non-<foo> tags from the input and re-format it slightly.