Is the perl script supposed do output to the browser? If so make sure this code appears before any output is written:
print "Content-type: text/html\n\n";
- this assumes the script does html output, if it does something else (like xml) then you'll need to change the header accordingly