converts HTML file for display (Perl regex exercise)