in reply to browser downloading perl script
Here's something that definitely triggers the kind of event you are talking about, especially when using Internet Explorer 5.0: forgetting to print out the MIME/HTML header.
print "Content-type: text/html\n\n";
What you described just happened to me (I downloaded the output of my script as a file and saved it to my so-called \Desktop) because my MIME/HTML header printing subroutine is foobar'ed for some reason. Hopefully, I will be able to fix it.
Otherwise, I will cry.