CGI is already configured and working in the default XAMPP installation using MiniPerl.
Click on these links when your Apache server is running:
http://localhost/cgi-bin/perltest.cgi
http://localhost/xampp/perl-info.php
The example perl scripts below are in the XAMPP cgi-bin directory:
.\xampp\cgi-bin
and this is the location you could put your own scripts, then call them in your browser like this:
http://localhost/cgi-bin/mycgiscript.cgi
For example, click on this link when your Apache server is running:
http://localhost/cgi-bin/perltest.cgi
Or click on this to run a cgi script that will show you your system environment variables:
http://localhost/cgi-bin/printenv.pl
Make sure that you have the path to the perl interpreter as the first line of your own scripts (the Shebang).
Fo example:
#!"C:\xampp\perl\bin\perl.exe"
Your path to perl may be different.
If you want to run .cgi perl scripts and .pl perl scripts from the htdocs directory then change this line near 423 in
.\xampp\apache\conf\httpd.conf
AddHandler cgi-script .cgi
so it looks like this:
AddHandler cgi-script .cgi .pl
Save the file and restart Apache and remember to make a backup of conf and ini files before changing anything.