$_ = join '', ; while(s/<(?:\/?\w|!)[^<>]*>/ /sg) {} s/ +/ /g; s/^ | $//mg; print; __DATA__ Once upon a time there was a link and some bold text and a paragraph break

and a
table
4 < 5 > 3