Jump to content

Recommended Posts

Posted

I would appreciate some help to get perl scripts running on helio host.

 

I have uploaded my perl script to /home1/directory/public_html/cgi-bin

I have set permissions on the script to 755

I have added #!/usr/bin/perl to the first line of the script

I am testing the script using http://website.heliohost.org/cgi-bin/gf_test.pl

 

However, the script does not run at all and gives an Internal Server Error.

 

Can anyone tell me what I am doing wrong. :blink: I have spent ages trying to get a perl script to work but need some guidance.

 

My test script is below

 

#!/usr/bin/perl

 

$words="Hello World";

&fscreen($words);

 

sub fscreen

{

my ($xwords) = @_;

 

print <<__;

Content-type: text/html

 

$xwords

__

}

Posted

If you are looking for some help getting that code working I won't be able to help (I am a beginner with Perl as well). However if you just want help getting something to work, I'll be glad to help. It looks like you have a sub routine but I don't see anything calling that subroutine to make it run. That might have absolutely nothing to do with it though.

 

Try this code instead:

#!/usr/bin/perl

print "content-type: text/html \n\n"; #HTTP HEADER

# DEFINE A STRINGS
$word= 'hello world';

# PRINT IT TO THE BROWSER
print $word."<br />";

 

I defined a string and then printed the string using print.

 

 

I would appreciate some help to get perl scripts running on helio host.

 

I have uploaded my perl script to /home1/directory/public_html/cgi-bin

I have set permissions on the script to 755

I have added #!/usr/bin/perl to the first line of the script

I am testing the script using http://website.heliohost.org/cgi-bin/gf_test.pl

 

However, the script does not run at all and gives an Internal Server Error.

 

Can anyone tell me what I am doing wrong. :blink: I have spent ages trying to get a perl script to work but need some guidance.

 

My test script is below

 

#!/usr/bin/perl

 

$words="Hello World";

&fscreen($words);

 

sub fscreen

{

my ($xwords) = @_;

 

print <<__;

Content-type: text/html

 

$xwords

__

}

  • 1 month later...
Posted

Previous post answered your query, I guess.

 

Just to reiterate: For making a perl script run ion almost all servers, check 3 things:

 

1- permission 755 (if accessing via browser to run it)

2- The #! line

3- Do this before outputting anything: print "content-type: text/html \n\n"; #HTTP HEADER

 

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...