Jump to content

Creating Web Apps using Strawberry Perl on Windows Vista

newPerlJammer's Photo
Posted Jun 25 2010 04:24 AM
5763 Views

I have recently downloaded strawberry Perl 5.10 for Windows Vista. I want to write Perl programs that can run in a Browser. I have written (copied) a simple perl script that is supposed to output to IE. However, when I put this in the Browser address bar: C:/inetpub/wwwroot/simpleStrawBPerlScriptInBrowser.pl it simply opens the file in notepad. Here is the contents of the file:

print "Content-type: text/html \n\n"; #HTTP HEADER

#CREATE STRINGS WITH ESCAPING CHARACTERS
$string = "David paid \$4.34 for Larry\'s shirt.";
$email = "youremail\@youremail.com";

#PRINT THE STRINGS
print "$string<br />";
print "$email<br />";
print '$string and $email';



Windows Vista comes with IIS 7.0. How do I configure my Perl Script to run in the Browser?

Tags:
1 Subscribe


2 Replies

-1
  jwgaynor's Photo
Posted Jun 25 2010 07:11 AM

You need a cgi directory to place your perl programs in and you need to name them as program_name.cgi, example:

http://www.mysite.ne...n/some_cgi_prog

Or inside of a web page, (following all on one line):

Click <a href="http://www.mysite.net/cgi-bin/my_perlprog.cgi">here</a> to run your program.

:rolleyes:
0
  brian_d_foy's Photo
Posted Jul 08 2010 04:11 PM

Running a CGI program means that you not only have to make the program, but manage a web server to respond to your web browsers request. It's a much bigger topic than merely writing a Perl script and running it.

ActiveState has instructions for <a href="http://community.activestate.com/forum-topic/configuring-perl-on-iis-7">setting up Perl with IIS 7</a>. You'll just need to change the ActiveState specific bits to use the right information for Strawberry Perl.

Additionally, you can learn more about IIS 7 at <a href="http://learn.iis.net/">the official IIS site</a>, which has documentation for that web server.