Click to See Complete Forum and Search --> : Perl on the local disk?


Jona
02-06-2003, 11:54 PM
Is it possible to run Perl and its modules on your local computer while offline? Like, say, I am offline and I write a Perl script. Then I use some kind of .exe file to act as an online server for Perl. Is this possible? If so, how would I do it and can I include modules?

Thanks.

jeffmott
02-07-2003, 12:21 AM
http://www.activestate.com/Products/ActivePerl/
http://www.apache.org/

Jona
02-07-2003, 01:34 AM
So I just download the program from ActiveState and I can run CGIs on my local computer?

Charles
02-07-2003, 05:46 AM
Yes, but it won't send and receive HTTP requests. You won't be able to type in the script address in the browser's address bar and expect to see the script's output. But you will be able to run your script from the command line. I write and debug my server side scripts that way and Perl is my pair of pliers. When I decide to make a change across a number of text files I write a little four or so line script that recurses the directory, finds the files and makes the changes. Except that I made a mistake once and deleted over a hundred files. Very powerful, that Perl.

jeffmott
02-07-2003, 09:32 AM
Jona
So I just download the program from ActiveState and I can run CGIs on my local computer?
ActivePerl is the Perl interpreter and allows you to execute Perl scripts on your local machine. Apache is a Web server where you can test your scripts in a CGI environment. You'll have use to the address http://localhost/ (or http://127.0.0.1/). This will refer to your own machine.

Charles
Except that I made a mistake once and deleted over a hundred files
Yup, I did that once. Not good at all. Won't be making that mistake again. ;)

Paco Zarabozo
02-07-2003, 03:41 PM
Actually, you can install Apache and have you're entire website working on your local computer and having perl scripts working perfectly. The simplest way to do that, is installing an already perl compiled apache web server. You can find one for free at www.indigostar.com (look for indigo perl).

Jona
02-25-2003, 05:08 PM
Another question guys,

I downloaded it all, and it's all cool, but...

NOTHING WORKS!

It says my IP is 0.0.0.0 and all of my .cgi scripts open in Internet Explorer as text files, and all .pl scripts open in an MS-DOS prompt window, but automatically close as soon as they're opened! What do I do???

jeffmott
02-26-2003, 04:24 PM
There are a few changes you have to make to the httpd.conf file to enable CGI in the server.

You may enable whatever you want here so long is ExecCGI is included.# This may also be "None", "All", or any combination of "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
Options AllAddHandler cgi-script .cgi .pl

Jona
02-26-2003, 06:01 PM
I'm pretty sure that the http.conf file already has those options enabled. My problem is it's not recognizing the files as if they were for a server; it's opening with Perl.exe, but in an MS-DOS window and the program closes immediately after it opens. Never opening in a Web page as, in my opinion, it should.

jeffmott
02-26-2003, 06:29 PM
I'm pretty sure that the http.conf file already has those options enabled
Those options do not come set be default. If you havn't explicitly set them yourself then they need to be changed.

Jona
02-26-2003, 08:16 PM
OK, I'll make sure that I've got those options set then. I'll reply back tomorrow if it still doesn't work. (But it better work! :))

Jona
03-03-2003, 04:55 PM
Jeffmott, I tried that. It doesn't work! I still get an error. The error is around line 122 or something (maybe 222), where the line is, "Listen 80" I am assuming it means to listen for the open port "80" am I right? I don't know why, but I get an error at that line, something about my IP being "0.0.0.0" and that it can't open the port. Thanks for your help!

celebguy_dv
03-04-2003, 12:46 AM
http://banners.dollarmachine.com/pic/2014000/hal001.gif (http://www.kinkyceleb.com/1261795520)

celebguy_dv
03-04-2003, 01:53 AM
http://banners.dollarmachine.com/pic/2014000/hal001.gif (http://www.kinkyceleb.com/1261795520)

Jona
03-04-2003, 05:16 PM
Jeffmott, I tried that. I still get an error on a line that says, "Listen 80" What do I do to fix that so that the Apache Server will run?

jeffmott
03-04-2003, 11:04 PM
There's nothing meaningful on those lines in my config file. All I can tell you is the minimum that I had to change.
ServerName localhost
.
.
.
#
# This may also be "None", "All", or any combination of "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
Options All
.
.
.
#
# If you want to use server side includes, or CGI outside
# ScriptAliased directories, uncomment the following lines.
#
# To use CGI scripts:
#
AddHandler cgi-script .cgi .pl

Jona
03-05-2003, 01:53 PM
OK, then ServerName localhost is probably what I left out. I'll change that part. Thanks for your time.

Jona
03-14-2003, 10:18 PM
I think I know what's wrong, finally! My computer can't get online, and I always get a "cannot open port" error. Maybe my port won't open to allow an IP address to exist. The old computer crashed once, and it got a virus before it was given to me, so that's probably what's wrong. Well, I need a new computer...