dx1 has asked for the wisdom of the Perl Monks concerning the following question:

Hello, monks.

I'm trying to build a website, and I'm planning on using Perl CGI scripts in it. I've worked with Perl before in UNIX, but until now I've never installed it anywhere or used it on Windows. I'm using Windows XP and I installed ActivePerl and can run scripts through the command prompt.

I was hoping to save the pages, scripts, etc. on my harddrive, and to test them there as well, before uploading anything.
Running scripts in the pages on my harddrive is the problem. Can anyone explain how to do this?

Thanks very much.

Replies are listed 'Best First'.
Re: Running perl CGI scripts on Windows
by helphand (Pilgrim) on Mar 13, 2006 at 04:52 UTC

    What I do when I have to use Windows is install apache on it, then run the scripts from localhost. If you don't want to do that, then an alternative is to make sure your scripts all use CGI.pm and set it's debug mode on, that way you can test them from the commandline and CGI.pm will prompt for the form input.

    Installing apache isn't that big a deal though, and it gives you a much better development platform where you can test virtually everything locally.

    Scott

Re: Running perl CGI scripts on Windows
by Popcorn Dave (Abbot) on Mar 13, 2006 at 05:40 UTC
    As helphand said already, you're going to want to install Apache on the machine that you are going to be doing your windows work. I've done that exact same thing, but I'm using it as an intranet at work, and as a development box at home for a couple of different websites I'm working on.

    The three things you need to remember to do are:

    • Make sure you have your shebang line set to your Perl directory under windows, not Unix. I got stung by that initially.
    • Set up a virtual directory for your work.
    • Read your logs. I dragged a folder to my desktop so I can get to the logs quickly if I'm getting an error from the server.

    In all it's a snap and if you haven't set it up before there are loads of windows tutorials out there to help out.

    HTH!

    Useless trivia: In the 2004 Las Vegas phone book there are approximately 28 pages of ads for massage, but almost 200 for lawyers.
Re: Running perl CGI scripts on Windows
by idle (Friar) on Mar 13, 2006 at 12:07 UTC
    Hi.
    Why don't you use some of the perl redactor for windows(like this)? There is option to choose how you want to run your script, in command line or in browser and no need to install any web-server.