in reply to ASCII to HTML

Well both examples create an odd thing:
<br> FOO<br> BAR<p><br> <br> BAZ<p><br> <br>

notice the extra break tags? where as a set of expressions will do the job like this:

$text = <<TEXT; FOO BAR BAZ TEXT $text =~s/\n{2,2}/<p>/g; $text =~s/\n{1,1}/<br>/g; $text =~ s/</\n</g; $text =~ s/>/>\n/g; print $text;

gives us this result

FOO <br> BAR <p> BAZ <br>
which i think is a little more of what you are looking for. I would suggest looking at the Regular Expressions book by O'Reilly. I left out some optimizations so you could go hunting for them.

take care

little_mistress@mainhall.com