itilv3 Posted July 29, 2011 Share Posted July 29, 2011 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. 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 __ } Quote Link to comment Share on other sites More sharing options...
Kenny09 Posted July 30, 2011 Share Posted July 30, 2011 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. 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 __ } Quote Link to comment Share on other sites More sharing options...
Sleek Posted September 29, 2011 Share Posted September 29, 2011 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 Quote Link to comment Share on other sites More sharing options...
vol7ron Posted November 3, 2011 Share Posted November 3, 2011 Do you still need help with this? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.