My browser tries to download the script instead of showing me the web page
If a browser wants to download the file, that means the header "Content-Type: text/html" isn't being written correctly by the script.
This usually happens for one of two reasons:
The script is encountering an error before it has a chance to write the Content-Type header. This is less common, about 5% of the cases, because usually when the script encounters an error, the web server itself will show it's "Internal Server Error" message.
The web server is not configured for CGI processing, at least not for the combination of file extensions, paths, permissions, and Perl binaries you have configured. Furthermore, the web server doesn't have a default Content-Type assigned to the .pl or .cgi extensions. As a result, the web server returns the script source code with Content-Type "application/octet-stream". Your browser doesn't know how to display "application/octet-stream", and so it prompts you to save the data stream to a file.
An easy way to tell which scenario you're facing is to go ahead and save the file, and then open it in a text editor. If you see the source code of the Perl script, then your web server is not configured for CGI processing. If you see output of the Perl script, then it will probably include error messages that you can use to correct the problem.
See also IIS custom error script returns script source code for a special case of this problem.
"My browser tries to download the script instead of showing me the web page" https://www.xav.com/scripts/guardian/help/2002.html