in reply to Displaying text files with perl.

Your question is really too broad to answer effectively. As has been previously mentioned, programs like MSWord (or OpenOffice) create and manage 'documents'. 'documents' can be quite complex, including tables, graphs, diagrams, headers/footers, sub/superscripts, etc, etc, etc...
You have a couple of options here. Both MSWord and OpenOffice allow you to save documents as web pages. This often includes the caveat that 'some formatting may be lost'. It will then depend on just how complicated you want to allow displayed documents to be. Also, both aforementioned programs support saving to RTF, and there is a CPAN module for processing RTF files. You could probably set up your 'upload' page the ability to choose either an html page, an RTF file, or a plain-text file for processing, if you want to be broad.