LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-25-2003, 10:23 AM   #1
hso_sof
LQ Newbie
 
Registered: Aug 2003
Posts: 6

Rep: Reputation: 0
Angry simple script


I'm just playing around with CGI, trying to create a simple script, and I keep getting an Internal Server Error for the code below. I checked all the permissions and everything. What's wrong with it?

#!/usr/bin/perl

$testnum=50;
$teststring='test';
$testsentence="This is just a $teststring";

print "Content-type: text/html\n\n";
print <<ENDHTML;
<HTML>
<HEAD>
<TITLE>Variable Test</TITLE>
</HEAD>
<BODY>
$testnum
<BR>
$teststring
<BR>
$testsentence
</BODY>
</HTML>

ENDHTML
 
Old 08-25-2003, 11:15 AM   #2
hso_sof
LQ Newbie
 
Registered: Aug 2003
Posts: 6

Original Poster
Rep: Reputation: 0
Does anybody have any idea about this script? I don't understand why it isn't working.

By the way, this is the error I receive:

Premature end of script headers
 
Old 08-25-2003, 12:09 PM   #3
hso_sof
LQ Newbie
 
Registered: Aug 2003
Posts: 6

Original Poster
Rep: Reputation: 0
I found out what I needed. I had to have a new line at the end of the script. It works now.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Iptables (with masq) troubleshooting, very simple script attached script and logs. xinu Linux - Networking 13 11-01-2007 04:19 AM
New to C++ help with simple script Fredstar Programming 9 08-08-2005 11:09 AM
Help on simple script granny Programming 2 02-11-2004 04:02 PM
Simple Script fiod Linux - General 2 09-08-2003 03:03 PM
Simple C Shell script is not so simple elconde Programming 2 09-16-2001 11:53 PM


All times are GMT -5. The time now is 02:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration