in reply to Re^3: Substitution inside tags, as 1 line
in thread Substitution inside tags, as 1 line

Thanks again NetWallah.

Here are some more alternatives, based on yours, which generate the output I was after, including removal of the <pre> tags. I guess your code is more correct via web standards, though.

perl -ne 'm|<pre>|..m|</pre>| and s/\n/<p>\n/;m|</?pre>| or print' htm +lfile perl -ne 'chomp;m|<pre>|..m|</pre>| and $_.="<p>";s|</?pre><p>|| or pr +int "$_\n"' htmlfile

Thanks for your ideas.