cancel
Showing results for 
Search instead for 
Did you mean: 

Perl CGI

breslaw
Newbie
Posts: 3
Registered: ‎12-01-2008

Perl CGI

Sorry if this is an old subject.
I'm an experienced Perl programmer.
I'm new to plusnet.
I'm trying to get a small web application hosted.
As a basic test, I installed a perl 'hello world' script in my cgi-bin directory.
It runs fine from the command line.
Permissions are 755.
When run from a browser it produces "Internal Server Error".
As a double check, I installed the equivalent php 'hello world' script in cgi-bin.
It runs fine from the command line and in a browser.
I raised a ticket asking what I had done wrong.
They replied that it is my responsibility to understand CGI technicalities.
They also admit that a link to perl help in the CGI tutorial page does not work.
Hmmph.  -Sad
Any ideas.
Thank you.
2 REPLIES
ffupi
Grafter
Posts: 370
Registered: ‎01-08-2007

Re: Perl CGI

Hello
Don't understand the PERL-syntax, but this file test.pl runs happily via browser on cgi-bin:
#!/usr/bin/perl -w

use strict;
use CGI::Carp qw(fatalsToBrowser warningsToBrowser);

print "Content-type: text/html\n\n";
print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">', "\n";
print "<html><head><title>Testausgabe</title>\n";
print "</head><body>\n";
print "Wenn Du das siehst, funktioniert Perl auf Deinem System !<br><br>";
print "If you see this perl works fine on your system !";
print "</body></html>\n";

This tutorial: http://usertools.plus.net/tutorials/id/25 includes some PERL stuff for to run webstats. This explains how to transfer the file: http://usertools.plus.net/tutorials/id/22
Hope it contains something of interest.
Nice day
breslaw
Newbie
Posts: 3
Registered: ‎12-01-2008

Re: Perl CGI

I had assumed a content type of text/html, rather than inserting
it explicitly.
Thank you very much for your help.