As specified in the HTTP RFC, a HTTP headerline should end with "\r\n", not with just "\n". Try the following CGI script:
#!/usr/bin/perl
print "Content-Type: text/plain\r\n\r\n";
print "It works!\n";
About your httpd.conf, CGIextension should not have a value that is also present in one of the CGIhandlers. With CGIhandler, Hiawatha runs the CGI handler program with the CGI script as the parameter. With CGIextension, Hiawatha just runs the CGI script, which can be any kind of program: a Perl script, a compiled C program, etc.
If you want Hiawatha to run a PHP script, you can configure Hiawatha in 2 ways:
The first one is:
...
CGIextension = php
ExecuteCGI = yes
...
This requires every PHP script to start with:
#!/usr/bin/php
<?
...
The preferable way to configure Hiawatha for PHP is:
...
CGIhandler = /usr/bin/php:php
ExecuteCGI = yes
...
You can know write (normal) PHP scripts that start like this:
<?
...
Hope this makes it all clear. If not, please let me know.