Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > "Hello World!" not working

Reply
Thread Tools

"Hello World!" not working

 
 
Admin
Guest
Posts: n/a
 
      09-20-2005
Hi Guys, I'm new to Perl, and I'm trying an "Hello World!" script but it's
not working. I tried it on 3 different servers and I always get "Internal
Server Error". Here's the script:

#!/usr/bin/perl
print "Content-Type: text/html\n\n";
print "hello world.\n\n";

The path to Perl is indeed /usr/bin/perl and I use a .pl or .cgi
extension. The script is in the cgi-bin folder. The file has 755
permissions. What is wrong?

--
Thanks,

Admin.
Want to buy me a book? http://tinyurl.com/78xzb
 
Reply With Quote
 
 
 
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      09-20-2005
Admin wrote:
> Hi Guys, I'm new to Perl, and I'm trying an "Hello World!" script but
> it's not working. I tried it on 3 different servers and I always get
> "Internal Server Error". Here's the script:
>
> #!/usr/bin/perl
> print "Content-Type: text/html\n\n";
> print "hello world.\n\n";
>
> The path to Perl is indeed /usr/bin/perl and I use a .pl or .cgi
> extension. The script is in the cgi-bin folder. The file has 755
> permissions. What is wrong?


Maybe you uploaded it from a Windows box to a *nix server in binary
mode. Try ASCII transfer mode instead.

Another thing you can try is adding a switch to the shebang line, e.g.

#!/usr/bin/perl -w

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
 
Reply With Quote
 
 
 
 
Shane
Guest
Posts: n/a
 
      09-20-2005
On Tue, 20 Sep 2005 18:19:16 -0300, Admin wrote:

> Hi Guys, I'm new to Perl, and I'm trying an "Hello World!" script but it's
> not working. I tried it on 3 different servers and I always get "Internal
> Server Error". Here's the script:
>
> #!/usr/bin/perl
> print "Content-Type: text/html\n\n";
> print "hello world.\n\n";
>
> The path to Perl is indeed /usr/bin/perl and I use a .pl or .cgi
> extension. The script is in the cgi-bin folder. The file has 755
> permissions. What is wrong?


is cgi-bin/printenv working?
if not, have a look at apaches httpd.conf
--
Hardware, n.: The parts of a computer system that can be kicked

The best way to get the right answer on usenet is to post the wrong one.

 
Reply With Quote
 
A. Sinan Unur
Guest
Posts: n/a
 
      09-20-2005
Admin <(E-Mail Removed)> wrote in
news(E-Mail Removed):

> Hi Guys, I'm new to Perl, and I'm trying an "Hello World!" script but
> it's not working. I tried it on 3 different servers and I always get
> "Internal Server Error". Here's the script:
>
> #!/usr/bin/perl
> print "Content-Type: text/html\n\n";
> print "hello world.\n\n";
>
> The path to Perl is indeed /usr/bin/perl and I use a .pl or .cgi
> extension. The script is in the cgi-bin folder. The file has 755
> permissions. What is wrong?


Who knows?

What did you see when you checked the error log?

Oh, and, why are you lying about the content type?

Sinan

--
A. Sinan Unur <(E-Mail Removed)>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/cl...uidelines.html
 
Reply With Quote
 
Sherm Pendley
Guest
Posts: n/a
 
      09-20-2005
Admin <(E-Mail Removed)> writes:

> Hi Guys, I'm new to Perl, and I'm trying an "Hello World!" script but
> it's not working. I tried it on 3 different servers and I always get
> "Internal Server Error". Here's the script:


Have you read (and followed) the advice in the Perl FAQ?

perl -q 500

There are two very useful links in there.

sherm--

--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
 
Reply With Quote
 
Admin
Guest
Posts: n/a
 
      09-20-2005
On Tue, 20 Sep 2005 19:12:34 -0300, Sherm Pendley <(E-Mail Removed)>
wrote:

> Admin <(E-Mail Removed)> writes:
>
>> Hi Guys, I'm new to Perl, and I'm trying an "Hello World!" script but
>> it's not working. I tried it on 3 different servers and I always get
>> "Internal Server Error". Here's the script:

>
> Have you read (and followed) the advice in the Perl FAQ?



Thank you. I didn't change anything, but for some reason, the "Hello
World" script is working now

--
Thanks,

Admin.
Want to buy me a book? http://tinyurl.com/78xzb
 
Reply With Quote
 
Big and Blue
Guest
Posts: n/a
 
      09-21-2005
Admin wrote:
>
> #!/usr/bin/perl
> print "Content-Type: text/html\n\n";


So, you say you're going to send HTML, but then...

> print "hello world.\n\n";


...you sedn ordinary text (ie: text/plain).

You don't just have a Perl problem here.

PS: I'm convinced I made a similar reply to a similar post about a month
ago. Ah, yes. That was from "NullBlock". Only difference was (s)he
spelt "Hello, World." correctly (but you've both omintted the !).

So, has "NullBlock" been promoted to "admin"?


--
Just because I've written it doesn't mean that
either you or I have to believe it.
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
response.redirect is not working but server.transfer is working gaurav tyagi ASP .Net 14 01-20-2006 04:22 AM
wifi not working on new hp, or not working after live update =?Utf-8?B?RHJhZ29ueA==?= Wireless Networking 1 10-01-2005 11:17 PM
ASP.NET client-side validation working, but button click not working Alan Silver ASP .Net 1 08-02-2005 03:50 PM
Cookies working on intranet but NOT working on Internet Martin Heuckeroth ASP .Net 5 04-01-2005 01:37 AM
Regular Expression validators NOT working, Required Field validators ARE working Ratman ASP .Net 0 09-14-2004 09:36 PM



Advertisments