Hello World - Perl => Download?

Status
Not open for further replies.

cmo0118

New Member
Messages
9
Reaction score
0
Points
0
Hello,

I have a simple question about how to run Perl program. When I clicked this link:

http://cmo.x10hosting.com/cgi-bin/test.pl

I supposed to see a blank page with "hello world" but instead the server ask me to download this file or open it. Did I miss anything?

Related files are as the following. Any comment will be appreciated.

[.htaccess]

<FilesMatch "test.pl">
SetHandler perl-script
Options +ExecCGI
</FilesMatch>

[test.pl]

#!/usr/bin/perl
BEGIN { push @INC, "/home/cmo/www/cgi-bin"; }
use strict;
print "Content-type: text/html\n\n";
print "hello world";
 

Jarryd

Community Advocate
Community Support
Messages
5,534
Reaction score
43
Points
48
Some perl module isn't installed if it's asking you to download. I don't really understand how perl works though. Maybe someone else can help.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
[.htaccess]

REMOVE THESE LINES ...THEY ARE WHAT IS CAUSING THE PROBLEM
<FilesMatch "test.pl">
SetHandler perl-script
Options +ExecCGI
</FilesMatch>

You do not have to set the handler.
 
Last edited:

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
I removed "setHandler" but got a error message :
File does not exist: /home/cmo/public_html/500.shtml


Remove the entire FilesMatch construct.

If you still have problems, post the entire contents of .htaccess
 

cmo0118

New Member
Messages
9
Reaction score
0
Points
0
Remove the entire FilesMatch construct.

If you still have problems, post the entire contents of .htaccess

Thanks for your reply.
Since FilesMatch is the only directive in .htaccess, I deleted the whole and ran it again. Still not luck. I got this error message. Any idea?

"File does not exist: /home/cmo/public_html/aa/500.shtml"

url:
http://cmo.x10hosting.com/test.pl

test.pl:
#!/usr/bin/perl
BEGIN { push @INC, "/home/cmo/public_html/aa"; }
use strict;
print "Content-type: text/html\n\n";
print "hello world";
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Please check the permissions on the script.
 
Status
Not open for further replies.
Top