in reply to Printing contents of file on a HTML page.

In addition to the other comments in this thread...

If the file is the entire contents of your response, you should make sure to make the response have a text/plain MIME type, or the browser will interpret entities and tags incorrectly.

If the file is part of a larger response, you'll need to encode the entities. The simplest way to do that is with the HTML::Entities module:

use HTML::Entities qw(encode_entities); print "<pre>"; print encode_entities($_) while <HANDLE>; print "</pre>";

-- Randal L. Schwartz, Perl hacker