I've already explained why your code produces the a.html you're seeing.
Your code should not produce the b.html you are seeing unless you are wrong about your input, you are wrong about your code, you are wrong about your output, or your Perl is broken.
I've already shown the code that will get you what you want, so what you are asking now?
In reply to Re^3: command line replace incorrectly indexes $.
by ikegami
in thread command line replace incorrectly indexes $.
by cmarcum
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |