in reply to directory printing
As an alternative to using the <br> tag, you could wrap your output with
<pre>...</pre>
In that case you might want to adjust the style to match the rest of the HTML, if style matters. That should also prevent funny problems with special characters in the filename.
In Section
Seekers of Perl Wisdom