My system is configured as follows:
Web root = c:/www
Apache version = 2.2.6
Apache installation directory = c:/Apache2.2/
#!c/Perl/bin/perl
print "Hello, World...\n";
Start > Run > cmd > Ok
type perl hello.pl
If you see Hello, World..., Perl installed correctly, otherwise reinstall ActiveState Perl.
Options Indexes FollowSymLinks
Options Indexes FollowSymLinks ExecCGI
#AddHandler cgi-script .cgi
AddHandler cgi-script .cgi .pl
#!/Perl/bin/perl
print "Content-type:text/html\n\n";
print "hello world";
Save it as c:/Apache2.2/cgi-bin/hello.cgi. View http://localhost/cgi-bin/hello.cgi in your browser. If you see hello world, CGI is working correctly.
Very often you would not want to run CGI from an Apache directory. To change the cgi-bin, create the folder
c:/www/cgi-bin/
ScriptAlias /cgi-bin/ C:/www/cgi-bin/
<Directory "C:/Apache2.2/cgi-bin">
<Directory "C:/www/cgi-bin">
Perl errors are logged in the Apache error log. To view it, go to Start > Apache HTTP Server 2.2.6 > Review Server Log Files > Review Error Log or
C:/Apache2_2/logs/error.log