in reply to Replacing underscore characters with whitespace
Some introductory reading...
Also,you should consider a templating system such as HTML::Template (or at very least some heredocs).
Update:
this is inputted from a form
Are you using CGI.pm to parse the input? I assume you have taint mode enabled and are checking all the parameters (especially ones like $surveyoffice_base_dir), right? If not, read this.
Another Update: reading up on s/// might help you out a bit as well. Please look into the above suggestions first though, they are very important.
In Section
Seekers of Perl Wisdom