I created a perl script (test.pl) that uses CGI. When I run it on my local NT server (using Xitami). It runs fine. When I ftp it onto our Unix web server and set the permissions to 755 (rwxr-xr-x), the file is accessible through the web but it is displayed as a downloadable text file instead of running the perl code. Are there any paths, variables, etc. that need to be defined on the Unix side? I verified that CGI.pm exists on the Unix side in the '/usr/local/lib/perl5/5.00502' directory but I'm not sure what else is required.
The code is as follows:
#!/usr/bin/perl
# CGI script that creates a fill-out form
# and echoes back its values.
use lib '/usr/local/lib/perl5/5.00502';
use CGI qw
standard);
print header,
start_html('A Simple Example'),
h1('A Simple Example'),
start_form,
"What's your name? ",textfield('name'),p,
"What's the combination?", p,
checkbox_group(-name=>'words',
-values=>['eenie','meenie','minie','moe'],
-defaults=>['eenie','minie']), p,
"What's your favorite color? ",
popup_menu(-name=>'color',
-values=>['red','green','blue','chartreuse']),p,
submit,
end_form,
hr;
if (param()) {
print "Your name is",em(param('name')),p,
"The keywords are: ",em(join(", ",param('words'))),p,
"Your favorite color is ",em(param('color')),
hr;
}
The code is as follows:
#!/usr/bin/perl
# CGI script that creates a fill-out form
# and echoes back its values.
use lib '/usr/local/lib/perl5/5.00502';
use CGI qw
print header,
start_html('A Simple Example'),
h1('A Simple Example'),
start_form,
"What's your name? ",textfield('name'),p,
"What's the combination?", p,
checkbox_group(-name=>'words',
-values=>['eenie','meenie','minie','moe'],
-defaults=>['eenie','minie']), p,
"What's your favorite color? ",
popup_menu(-name=>'color',
-values=>['red','green','blue','chartreuse']),p,
submit,
end_form,
hr;
if (param()) {
print "Your name is",em(param('name')),p,
"The keywords are: ",em(join(", ",param('words'))),p,
"Your favorite color is ",em(param('color')),
hr;
}