FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Executing a Perl CGI script





palciere
Here is the html file I used successfully to access a Perl CGI script when I was on Hypermart.net. Can I just replace "paulalciere.hypermart.net" with "palciere.frihost.org" and have it work?

<!-- ice cream.htm -->
<html>
<head>
<title>Ice Cream</title>
</head>
<body>
<h1>Hello Ice Cream</h1>
<form action="http:paulalciere.hypermart.net/icecream.pl">
What is your flavor? <input name="favorite" value="mint">
<p>
<input type="submit">
</form>
</body>
</html>


Here is a Perl script that worked with the above.

#!/usr/bin/perl -w
# icecream.pl version 3
use CGI qw(:standard);
print header(), start_html("Hello Ice Cream"), h1("Hello Ice Cream");
my $favorite = param("flavor");
if ($favorite) {
print p("Your favorite flavor is $favorite.");
} else {
print hr, start_form;
print p("Please select a flavor: ", textfield("flavor", "mint"));
print end_form, hr;
}
print end_html();

Will this work on our system? I assume I should put this script in public_html/cgi-bin. Is that correct? Should I call the script icecream.pl or icecream.cgi?
Bondings
I would use .pl for perl scripts.

And yes you will need to change the url in the file as you mentioned.

Also, to execute perl and other cgi scripts, you need to have a .htaccess file in the same directory with the following code:
Code:
Options +ExecCGI
AddHandler cgi-script cgi pl
Related topics
Suggest a Free or Trial classifieds script
All the SCRIPT u Need
Convert CGI script to php and MySQL
perl help... script almost working... please help..
Perl CGI 500 Internal Server Error
cgi script outsite cgi-bin
PERL scripts + directories
What happened to Perl?
I find python is still not as popular as perl
I find python is still not as popular as perl
CGI-script
executing a perl script from within a script
SPLIT long task?
Python CGI script 500 error
Reply to topic    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.