| Member with 71 posts. | | Join Date: Sep 2009 Location: London Experience: Intermediate |
28-Oct-2009, 08:03 AM
#14 |
Quote:
Originally Posted by andynic Problem seems to be solved.
An interesting sidelight: The script extension needs to be ".cgi". Then it works as expected in the Safari browser. If the script has extension ".pl", it causes a file to appear in the download list. Then if you open that file, the output is there. | This is because your AddHandler directive stated Code: AddHandler cgi-script .cgi Which means that only filenames ending in .cgi are treated as cgi scripts. If you'd written Code: AddHandler cgi-script .pl Only .pl would. Quote: |
All seems very mysterious. From what I can find, so far, these switches are just the command line perl options. "-w" from the command line simply allows the perl interpreter to generate warings. I don't see what it has to do with stopping the Apache server from generating error 500.
| It shouldn't change it.
Perl scripts, in general, should be headed with Code: #! /usr/bin/perl
use strict; Because the strict pragma stops you doing several dangerous things. Warnings can be really handy to tell why it went wrong, though, or more often, that you didn't notice it going wrong. It warns of things like variable assignments that never get used, or variables being clobbered before use. Things that you might well want to do, but probably don't.
As I said above, an http500 error on a cgi script is generally the script failing.
Last edited by Lordandmaker; 28-Oct-2009 at 08:09 AM..
|