I have this Perl script sitting in the cgi-bin folder of my Apache server:
#!/usr/bin/perl
use strict;
use warnings;
$| = 1;
print \"Content-type: text/ht
Assuming you are using a version of Apache newer than 1.3, this should work. otherwise, You'll have to make your script into an NPH (No Parsed Headers) CGI, meaning its filename should be prefixed with nph-
and it should output complete HTTP headers, eg.
HTTP/1.1 200 OK\n
Content-type: text/html\n\n
see the (somewhat old)Apache FAQ for more info