Help with VERY basic perl

Status
Not open for further replies.

dparedes

New Member
Messages
2
Reaction score
0
Points
0
I am trying to make hello world in perl.

here is what I currently have:

#!/usr/bin/perl
$text = 'hello world';
print "$text\n";


I made a folder called cgi-bin in the public-html folder but all i get as an output is
500 internal server error

Can some one please help me
 

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
I think you should have posted this in programming.

Read the last part; the 500 Internal Server Error is a possible free-hosting problem, not a programming problem.

It's in the right area, I just dunno how to fix it. Just posting to acknowledge it -is- in the right spot.
 

diamondpc

New Member
Messages
48
Reaction score
0
Points
0
Right on.. i wasnt sure.. thats iwhy i said what i did..lol just kick me.
 

adamparkzer

On Extended Leave
Messages
3,745
Reaction score
81
Points
0
The way I'm used to doing the perl Hello World is by using print "Hello World";. I dunno if that has anything to do with your problem, though.

I've seen 500 Internal Server Errors when people have had defective .htaccess files. Check and see if there are any lines of code in your .htaccess file that are combined into one line and thus misinterpreted by the server.
 

leafypiggy

Manager of Pens and Office Supplies
Staff member
Messages
3,819
Reaction score
163
Points
63
There may be something with a MIME type you need to add.

No clue though. The only time I ever worked with perl was when I tried to save FileFront. haha
 

ProperNoun

New Member
Messages
1
Reaction score
0
Points
1
Yeah, you're not sending a content type header. Don't worry, this is by far the most common new-to-Perl speed bump. Try this...

Code:
#!/usr/bin/perl
use strict; # Always.
use warnings;
print "Content-Type: text/plain\n\n";
my $text = 'hello world';
print $text;

...and don't forget file permissions.
 
Status
Not open for further replies.
Top