Re: browser not executing perl
by Beatnik (Parson) on Jun 19, 2002 at 22:23 UTC
|
You need - A webserver to put the scripts on (check Apache)
- CGI configurred on that webserver
If you already have a webserver, then step 2 is regulary the problem... Small note: Your browser doesnt execute the scripts, the server does :)
Greetz
Beatnik
Perl is like sex: if you're doing it wrong, there's no fun to it. | [reply] |
|
|
Adding to Beatnik's list, check to make sure that the file is chmod'ed correctly on a linux system. I don't know if this could have any effect but maybe the path to Perl is wrong? Let us know what was wrong.
-Stormgard
| [reply] |
|
|
| [reply] |
|
|
| [reply] |
Re: browser not executing perl
by emcs (Scribe) on Jun 19, 2002 at 23:39 UTC
|
If you are using a Windows machine this link may help.
Indigo perl is a free Perl distribution, that comes packaged with "Apache" web server; it is very easy to set up and install.
It is available at:
indigoperl.htm
emcs
The dogs bark; but the caravan rolls on. | [reply] |
Re: browser not executing perl
by stormgard (Novice) on Jun 20, 2002 at 00:30 UTC
|
I just remembered. It has to do with what you have setup for the web server. Assuming it is on apache, tell the admin to add this line (it should already be there, just needs to add the .pl or .cgi extension (maybe even uncomment it)):
AddHandler cgi-script .cgi .pl
As long as the server is setup to allow execution of Perl CGI scripts, it will pickup .cgi and .pl extensions as a cgi script.
-Stormgard | [reply] |
Re: browser not executing perl
by Aristotle (Chancellor) on Jun 19, 2002 at 23:46 UTC
|
| [reply] |
|
|
Or just roll your own webserver with HTTP::Daemon. It's suprisingly easy for a one-shot script. Multiple functions cause minor headaches.
Update: I dispute that Apache is hard to setup on Linux. Many distributions will install it unless restrained at install time. To use scripts with it, you copy your script into your cgi-bin directory, name it script.cgi, chmod a=rx script.cgi and you are off and running. Even microsoft couldn't make it any easier. ____________________
Jeremy
I didn't believe in evil until I dated it.
| [reply] |
|
|
While HTTP::Daemon may be easy to use, it is not advisable practice. For one, if you need to write a script to run on YourAverageHost.Com, it will invariably be a CGI script. Even when that is untrue and the script in question is going to run on your own machine, running a HTTP daemon for every single script you may or may not need at one time or other is simply an unnecessary waste of resources (memory, CPU, socket handles) and presents a box with a million open ports to anyone who happens to scan you. And without meaning to be condescending to her, if danielle is asking such a question I doubt she has the experience to have a grasp of all of the security concerns that play a role in writing a daemon (although admittedly CGI is only marginally friendlier an environment).
In specific scenarios, HTTP::Daemon may be the tool to use. For the common tasks, it's not. Use the right tool for the right job..
Makeshifts last the longest.
| [reply] |
|
|
|
|
|
|
|
Re: browser not executing perl
by George_Sherston (Vicar) on Jun 20, 2002 at 09:31 UTC
|
If you're just starting out you may find some of the above excellent advice about setting up Apache on your own computer a bit daunting. One way to get your feet wet with CGI is to run the scripts on your webhost's server. Presumably you have or will have an ISP who can let you run your CGI scripts. So when you are sure the scripts run (tested at the command line), just upload them into the cgi-enabled directory on your web space (your ISP will tell you what you have to do to make this work). There are many ISPs that allow this, and offer it free or for very little. For example, cubesoft is American and good, uklinux is British and ditto.
§ George Sherston | [reply] |