Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   "Hello World!" not working (http://www.velocityreviews.com/forums/t894335-hello-world-not-working.html)

Admin 09-20-2005 09:19 PM

"Hello World!" not working
 
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 :)

Gunnar Hjalmarsson 09-20-2005 09:40 PM

Re: "Hello World!" not working
 
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

Shane 09-20-2005 09:46 PM

Re: "Hello World!" not working
 
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.


A. Sinan Unur 09-20-2005 09:53 PM

Re: "Hello World!" not working
 
Admin <me@privacy.net> wrote in
news:op.sxe6uea5uoj956@charles.mshome.net:

> 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 <1usa@llenroc.ude.invalid>
(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

Sherm Pendley 09-20-2005 10:12 PM

Re: "Hello World!" not working
 
Admin <me@privacy.net> 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

Admin 09-20-2005 10:28 PM

Re: "Hello World!" not working
 
On Tue, 20 Sep 2005 19:12:34 -0300, Sherm Pendley <sherm@dot-app.org>
wrote:

> Admin <me@privacy.net> 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 :)

Big and Blue 09-21-2005 09:39 PM

Re: "Hello World!" not working
 
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.


All times are GMT. The time now is 12:22 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.