in reply to Re^4: Problem printing contents of file
in thread Problem printing contents of file

What messages appeared in the error log?

500 is an "internal server error" which should be documented in the error log.

While developping you could use

use CGI::Carp qw(fatalsToBrowser);

to see fatal error messages (e.g. die messages) in the resulting error page...