Perl with XAMPP

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Perl with XAMPP

Postby Swan » 08. January 2008 09:14

I am not getting on how to start Perl after installing XAMPP. The XAMPP control panel doesnot provide any switch to start with Perl, which it provides for MYSQL, APACHE, Squirrel Mail etc.

Please Help . :)
Swan
 
Posts: 3
Joined: 08. January 2008 07:49

Postby Izzy » 08. January 2008 09:42

Perl is a scripting language not a server - you don't start it like a server, you start it from a file that has the perl script code within, usually with a .cgi or .pl file xtension.

The line that starts Perl is called the shebang which is always the first line of the file holding the perl code - Google it.

This is typical shebang on an XAMPP installed Perl script.
#!"C:\xampp\perl\bin\perl.exe"

As you can see this is what starts the Perl interpreter.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby Swan » 09. January 2008 03:14

Thanks,
But I know it's a scripting language ( Just like PHP ) .
My query is : like a php script ( say myscript.php) is kept in htdocs to run it. ( URL : http://localhost/myscript.php) similarly, where i am supposed to keep the myscript.pl or myscript.cgi to run it on my localhost ?

I had tried keeping myscript.pl in htdocs. But it loads it as a text file inside the browser. The script doesnot undergo any compilation process. :(
Swan
 
Posts: 3
Joined: 08. January 2008 07:49

Postby Izzy » 09. January 2008 06:05

But I know it's a scripting language ( Just like PHP ) .

Perl is not 'Just like PHP' - PHP is a server-side HTML embedded scripting language - PHP = HyperText Preprocessor.

Perl is treated differently to PHP by being contained within a Common Gateway Interface that the server knows the location of, and so will only use this CGI_BIN for executing code in an executable file (.pl or .cgi).

http://www.whenpenguinsattack.com/2006/ ... p-vs-perl/

You can't have, for obvious security reasons, executable files being executed all over the place.

I can hear you sat - "I know all that" - but IMHO your questions don't reflect your knowledge on the subject and so more reading should be in order.

So, your initial question I answered in detail as your question was, IMHO, a question from someone who knew absolutely nothing about Perl what so ever and my opinion has not changed one bit by your second question.

You are now asking another question entirely that is explained in detail if you care to read the cgi related items in the XAMPP for Windows home page
http://www.apachefriends.org/en/xampp-windows.html

and it would not hurt to read the XAMPP FAQ either
http://www.apachefriends.org/en/faq-xampp-windows.html

Also you should have read this before asking your very simple questions on these forums:
http://localhost/xampp/perl-info.php
http://localhost/perl/perlinfo.pl

All perl scripts go in the default cgi_bin until you change the location in the httpd.conf file or an httpd-vhosts.conf file as outlined in the XAMPP Home Page in case you missed it when your read that page.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby Swan » 10. January 2008 06:42

Izzy wrote:
But I know it's a scripting language ( Just like PHP ) .

Perl is not 'Just like PHP' - PHP is a server-side HTML embedded scripting language - PHP = HyperText Preprocessor.

Perl is treated differently to PHP by being contained within a Common Gateway Interface that the server knows the location of, and so will only use this CGI_BIN for executing code in an executable file (.pl or .cgi).

http://www.whenpenguinsattack.com/2006/ ... p-vs-perl/

You can't have, for obvious security reasons, executable files being executed all over the place.

I can hear you sat - "I know all that" - but IMHO your questions don't reflect your knowledge on the subject and so more reading should be in order.

So, your initial question I answered in detail as your question was, IMHO, a question from someone who knew absolutely nothing about Perl what so ever and my opinion has not changed one bit by your second question.

You are now asking another question entirely that is explained in detail if you care to read the cgi related items in the XAMPP for Windows home page
http://www.apachefriends.org/en/xampp-windows.html

and it would not hurt to read the XAMPP FAQ either
http://www.apachefriends.org/en/faq-xampp-windows.html

Also you should have read this before asking your very simple questions on these forums:
http://localhost/xampp/perl-info.php
http://localhost/perl/perlinfo.pl

All perl scripts go in the default cgi_bin until you change the location in the httpd.conf file or an httpd-vhosts.conf file as outlined in the XAMPP Home Page in case you missed it when your read that page.



cgi_bin for perl As htdocs for php...OK
Thanks a lot . :)
Swan
 
Posts: 3
Joined: 08. January 2008 07:49

Postby Wiedmann » 10. January 2008 10:41

cgi_bin for perl As htdocs for php...OK

If you change this line in httpd.conf (~419):
Code: Select all
AddHandler cgi-script .cgi

to
Code: Select all
AddHandler cgi-script .cgi .pl

you can put your perl scripts also in htdocs.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 45 guests