I am trying to run a perl script on tomcat server. I am getting the data from the incoming http request in a variable which collects the headers as well as the text file attachment data. The code is like this :