in reply to HTML to text

I think your posting is incomplete... for example
echo '<pre>foo</pre>' | perl -pe 's/<.*?>//g' # output: <prefoo</pre
I think you meant s/<.*?>//g ...

And of course, that is _very_ simplistic ... e.g. cases like:
<select> <option selected>foo</option> <option>bar</option> </select>
and of course (i know, not valid html, but we know it always happens):
<font color="red">2 >= 1</font>
Personally, my quick & dirty command-line snippet for this is often:
lynx --dump <file|url>