in reply to Re: Web Form with Perl
in thread Web Form with Perl

Hi, Thanks for your help. I tried the "Hello World" CGI script from: http://www.cs.tut.fi/~jkorpela/perl/cgi.html, but when I tried to run the script in my web browser (Google Chrome), All that my web browser gave me was the script that I had copied and pasted from the above web site. Chrome printed this:

#!/usr/local/bin/perl print <<END; Content-Type: text/html; charset=iso-8859-1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <title>Hello</title> <h1>Hello world!!</h1> END

Exactly what was inside the perl file I tried to run. There is probably some setting I need to change or program I need to use, but I'm totally stumped. Any help would be appreciated.

Replies are listed 'Best First'.
Re^3: Web Form with Perl
by Kenosis (Priest) on May 06, 2012 at 01:32 UTC

    The script will not run in your browser; perl scripts run on a server. Review the bullet items under the "Prerequisites" heading of The Fool's Guide to CGI.pm, the Perl module for CGI scripting, especially "...capabilities of using CGI scripting in Perl on some server as well as local information on how to do that."

    Under the subsequent "Hello world" heading, it says that, "You should now know where to put your Perl programs in order to run them as CGI scripts and what you might need to do with them (setting file protections, perhaps)."

    You'll either need to find a Web hosting service that supports Perl and CGI for your scripts or you can run a local Apache Web server with Perl and CGI on your own machine, e.g., XAMPP. Even if you opt for the former option, the latter provides a nice Perl CGI sandbox.