I'm running Windows XP Pro (Service Pack 2) with IIS 5.1 using DreamWeaver to host my own website locally. I wanted to add a "simple" random quote generator to my web page. However, this is a little be more complicated than anything I've tried to set up using Dreamweaver to date. Up to this point, I've been basically serving up bland HTML web pages to the servile masses, but I figured nothing ventured nothing gained and I was off to the races.
So, I was kinda flying blind. I Googled the net for a random quote generator and found a Perl script, and figured I'd try to get that working. However, in the process, I learned a few things:
Contact information is not required. Just click on Next. I selected the MSI package of ActivePerl for Windows version 5.8.6. During the ActivePerl install, you will be asked whether to set up an IIS mapping to the *.pl extension. Choose Yes (default). I installed with all default values. Just click next until it installs.
To verify that Perl is working, go to Start - Run and type in Command to get to the DOS prompt.
Attempt to execute the script:
This should work, at this point.
I had to add the .cgi file association. So, I allowed it to pick from a list and pointed it to Perl.exe. Then, I went into Windows Explorer - Tools - Folder Options - File Types - Select the CGI file type, click Advanced button, highlite Open action and click on Edit and change "Application used to perform Action" to:
"C:\Perl\bin\perl.exe" "%s" %s
This broke it good .Now it says "Can't open perl script "1": No such file or directory.
So, I changed it back to "C:\Perl\bin\perl.exe" "%1" %*
It actually works fine this way. So, I have .cgi and .pl scripts working from the command prompt.
Click on Start - Run and enter "Inetmgr" and it will launch the IIS manager.
In the Home Directory, click the "Create" button. It populates the "Application Name" field with "Default Application". You may want to change the "Execute Permissions" from "Scripts" to "Scripts and Executables". HOwever, in the end, I left mine at "Scripts" instead of "Scripts and Executables". The reason for this is that I have a lot of self-playing slideshows on my web page that are .exe files. When I selected "Scripts and Executables", it was letting IIS try to run the .exe files locally. So, whenever someone came in and clicked on my web site, I'd hear the music start playing and they didn't get their download. So, this was confusing to me and to them. In the end, I left it at "Scripts", because I'm only using .PL scripts any way. It's technically an interpreter language, and isn't really an "Executable". Clicking on Create also enables the "Configuration" button. Click on the "Configuration" button. You should see the .pl and .cgi extension mapping as "c:\perl\bin\perl.exe %s %s". If not, then add them manually. NOTE: The "%s %s" is case-sensitive (for example, "%S %S" does not work).
For Extension, type .pl., make sure that the All Verbs option is selected for full functionality, and that the Script Engine check box is selected.
Click Apply, and then at the Inheritance Override, click on Select All - OK to apply these permission changes to all child nodes.
Here's Microsoft's take on getting IIS 5.1 to work with Perl.
The changes should occur immediately. There is no need to reboot or restart IIS.
I copied my default scripts directory up to be under wwwroot and put my .pl and .cgi scripts in this directory. Now, the scripts should be accessible remotely as http://wepage/script/helloworld.pl
You can click on my retarded little test scripts and watch them run below:
OK, So, now I have IIS working with Perl Scripts. :)
"Configure Dreamweaver MX to work with Perl. Macromedia has added an extension to support Perl."
http://www.macromedia.com/cfusion/exchange/index.cfm?view=sn121&extID=1021086 I installed this one successfully. It didn't really help any, so far as I could tell, but it didn't hurt either, which usually the best you can hope for at 4:37 in the morning.
Eventually, after much surfing and scanning of html code, I realized that, through the miracle of HTML, I could execute my custom Perl script and display the resulting text string in an I-frame in a table. The Perl script that I ended up using was a modified version of this one http://sedition.com/perl/random-quote-cgi.html .
Challenges Dealing with Perl
I realized the following things in my attempt to use Perl scripts to generate dynamic html on my web page:
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Below are some Links(probably broken) that I found helpful. (Please don't report broken links to me. I really don't care.) I figured all of this out on my own in a matter of hours. If you can't figure it out, it doesn't mean that you're stupid, but signs do tend to point in that general direction.