#!C:\xampp\apache\bin\httpd.exe
$command=`perl -v`;
$title = "Perl Version";
print "Content-type: text/html\\n\\n";
print "<html><head><title>$title</title></head><body>";
print "
<h1>$title</h1>
\n";
print $command;
print "</body></html>";
I get this error:
Premature end of script headers:
version.cgi
You need to remove the extra backslash
This code:
Should be this:
EDIT
Also, the first line in the script looks wrong.
This should be the path to Perl, not httpd.
EDIT 2
Finally, this all would have been easier for you to solve if you added these two lines after the first line in your script:
And run the script on the command line with the -c -w flags to compile-check and warnings-check your script, ie
perl -cw yourscript.cgi. This will give you line numbers of errors and warnings in your script.Altogether, your script could look like this: