Page 1 of 1

How to run perl?

PostPosted: 05. March 2008 08:30
by mahes
Hi friends,

Am using PHP+Xampp. and i want to run a perl script using xampp?. what i do?
How do i change the configuration?

PostPosted: 05. March 2008 11:34
by Scory
You don't need to change anything, Perl is included in Xampp. You simply must write a Perl Script, store it in cgi-bin folder and start in browser via http://localhost/cgi-bin/script.cgi

The first line of the script MUST be the so called "shebang" line, a comment line which points to the executable module of the Perl interpreter. Something like that:

Code: Select all

Xampp comes with a "Mini-Perl" installation (i dont know if the above path is correct - you must look for it), but you may install any full Perl Intepreter instead and replace the first line in your scripts, for example:

Code: Select all

"ActivePerl" is most popular and free for Windows. If you are working in a Linux environment, you may use the Linux perl programm instead, what results in this shebang line:

Code: Select all

Most important is, that you store the scripts in cgi-bin folder. Read the docu about "ScriptAlias"-Directive of Apache and edit httpd.conf, if you want to change the default cgi folder.