Simple Problem W/ Perl - I can't get this hello world script

free web hosting
Free Web Hosting > Computers & Tech > Programming > Scripting > Perl & CGI

Simple Problem W/ Perl - I can't get this hello world script

egbert
Here's my code:
CODE

#!/usr/bin/perl
#
print "Content-type: text/html\n\n";
print "Howdy, world!";


I saved it in my cgi-bin with 777 permissions and It goes;
QUOTE
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@supper.astahost.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.


--------------------------------------------------------------------------------

Apache/1.3.33 Server at www.supper.astahost.com Port 80



I'm probably doing something really dumb... tell me what it is?

 

 

 


Reply

mastercomputers
I see nothing wrong with this script, as long as the file extension is .pl or .cgi it should work, I would try .pl as the extension first before attempting .cgi.

chmod 755 instead of 777.

0 = no permissions
1 = execute only
2 = write only
3 = write and execute
4 = read only
5 = read and execute
6 = read and write
7 = read, write and execute

CODE

#!/usr/bin/perl
#########
# hello.pl #
########
print "Content-type: text/html\n\n";
print "<p>Howdy, world!</p>";



Cheers,


MC

Reply

Trekkie101
Why 755 instead of 777?

It should affect that particular thing shout it?

Reply

mastercomputers
Yourself as the owner should have ( r)ead (w)rite and e(x)ecute permission over that file.

The group/others, such as 'the world' should not have writable access. In some cases, making the file world writable will not allow the script to be used at all, in which case it will most definitely work if set to 755, if your script needs to write to a directory, that's ok, it'll be executed under your owner's permission which you've given it the ability to write/delete.

All other regular files should have permissions set to 644.


Cheers,


MC

Reply

KnightEagle
QUOTE(mastercomputers @ Feb 14 2005, 04:47 AM)
Yourself as the owner should have ( r)ead (w)rite and e(x)ecute permission over that file.

The group/others, such as 'the world' should not have writable access.  In some cases, making the file world writable will not allow the script to be used at all, in which case it will most definitely work if set to 755, if your script needs to write to a directory, that's ok, it'll be executed under your owner's permission which you've given it the ability to write/delete.

All other regular files should have permissions set to 644.
Cheers,
MC
*



Thanks thisthread was helpful to me explans what I was doing wronge on a few pages. was using ws-ftp to change the permissions was going to far. will check it out in a few days. thatns for the info you may of answered two people at one shot.

 

 

 


Reply

html_man
The hello world thingy is just an simple example of what a CGI is, it doesnt do anything tho, and if u dont put it a 755 permission it will NOT work

Reply


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : perl script

  1. Help Needed To Create Login Script With Perl/cgi - Need Script (21)
    Have a format in mind and have a good idea how it works. So here what I need: step 1::: person must
    register: create handle // enter password // enter password // enter email : it then takes the
    person to acsepted page or reject per reason page. step 2::: login page: enter handle // enter
    password : takes them on it to the site of their control pages for each handle controls their own
    pages yet all pages interacts with the others. or bad password re login page. Have the page
    designed already have the script in html lang but one can create a password on the html page but...
  2. Perl : Help - How to run command lines (4)
    Hi there , I would like to have help with Perl. When I make a program and I run it , it close
    instantly after it is done. So how could I keep it open after his execution ? And also , where can
    I find Perl command lines ( if it exists for sure ) Thanks everyone , Happy new year. Mathieu_021...
  3. Maximum Number Of Decimal Places In Perl Language - (0)
  4. Perl Programming Language - (1)
    Hi, I want to use a big number in perl programming language. Unfortunately, my perl software does
    not support "BIGNUM". Is there another way to replace "BIGNUM" to solve my problem. Thank you for
    your feedback. ...
  5. Just Learning Perl - (6)
    Okay so I've decided to learn PERL. As I am VERY burned out on PHP after making an online
    hacking game in it and working on it for a month after release. Now that its almost done other than
    maintenance. I'm VERY good at php now. However I tried to do C and quickly thew my hands up
    (maybe too quickly). So I decided to learn PERL just to learn it. I'm curious, what are some
    practical uses for PERL (online. but more importantly offline/background/not used by public), does
    perl use the same if, else, while and the like as PHP? Thanks...
  6. Need To Install Script - $10 - (5)
    I need to install an multilevel affiliate script,the script is based on cgi perl and mysql I have
    installed the script but i am facing some errors ,so either you could correct them or reinstall it.
    A complete documentation for the install instruction is available in a detailed format. I would pay
    10$ (for installing or for correcting the errors) Please pm me if you are interested in this
    work. pm only if you are known with cgi perl and all needed to install the script...
  7. Simple Perl Script... - (1)
    I want to know the perl path to include at the beginning of the file....so that my perl scripts will
    run properly... Or is it ok to make a cgi-bin directory and put my perl scripts in it? Any reply is
    appreciated. cpn...
  8. Using Perl For Newsletter Subscription - (1)
    so I'm interested in adding a newsletter subscription to my website for visitors that are
    interested. I configured the cgi script, now I'm only wondering how to use the smtp feature with
    astahost.. would 'localhost' suffice, or will I be needing to get smtp auth? thanks for the
    help /biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" />...
  9. Share Your CGI Scripts Here - (1)
    If You Looking CGI Script or you want share information about it please comment here /cool.gif"
    style="vertical-align:middle" emoid="B)" border="0" alt="cool.gif" /> Stop using those horrible
    colors, fonts and font-sizes. ...
  10. What Is Perl? - (11)
    I have been looking high and low for a good domain service, and most places I have checked have Perl
    as a feature (including this one). What is Perl? It is included in the same info space that stuff
    like cPanel is put. But most importantly, how can Perl help me? If it can't, why do they
    advertise the ability to use it everywhere?...
  11. Best Place For Information On Perl - I would like to learn Pearl! (8)
    Hello, I would like to learn Pearl so that I can start working with CGI scripts so that I can in
    order to build a more inventive/interactive and dynamic website. I would like if someone could
    point me to a site were I can not only learn Pearl, but also download software to help devlop code.
    (An IDE of some type.) Thanks, Tim...
  12. Create Easily Modifiable Html Templates For Use In Your Perl Cgis - (0)
    Copied from http://www.tutorialized.com/tutorial/Ace-P...te-Creator/3364 QUOTE Hate having
    to place all the print statements in your program and having to escape all those quotes? Would you
    like to give the ability for people who don't know how to program in perl to customize the
    output of your cgis? Templates are the answer. Here's how it works. Take any html file and
    anywhere you place in(variable), it gets replaced with $in{'variable'}. For example, if
    you have $in{'name'} = 'bob' and an html file that has: Name: i...
  13. Perl: Exec Or System ? - which is best for this senerio (3)
    I am writing a script to add submit/add projects to a queue. I don't need a returned result
    other than it worked or failed. The script will execute a commandline like thisL 'program -b
    $filename -s $start -e $end -a' all I need is for that command to be send and if
    it suceeds return a simple "This worked" or "This failed: here is why ___________". I am just
    trying to remember the difference between exec and system() for this task. I've read through
    the documentation and am still a little confused. It's the first time I'v...
  14. Password Reminder And Password Change .htaccess - I need a script to change password (4)
    Hi, I use .htaccess to protect the members area of my site. I use a script called register.pl
    (search hotscripts and you'll see it) This script takes the username and password provided by
    the user and then enters the username and the encrypted password into the password file. What I
    want to do is, along with the username and password being taken, I want to also take the email
    address and when the user forgets his/her password all he has to do is type in the email, and the
    password will be sent. Thanks in advance, /smile.gif' border='0' style='vertical-align:mid...
  15. Strange Perl Behavior - (4)
    I have been working on a strange problem I've been having. I am reading a series of large files
    (50 mb or so) in one at a time with: @lines = ; or (same behavior with each) while( ){
    push(@lines, $_); } The first time I read a file it will read into the array in about 2
    seconds. The second time I try to read a file in (the same size) it takes about 20 seconds.
    Everything is declared locally inside the loop so, everything is leaving scope. I am not sure why it
    is taking so much longer the second time. I need to read the entire file in because I a...
  16. Sockets And Perl - for a chat script (1)
    Okay, I was trying to write a chat script for perl with tk for the GUI on active perl 5.8. But
    whenever I use the $socket->listen() function to connect to the client, the script always hangs
    on me. Any ideas as to how to avoid this problem (I've tried numerous codes including the one
    from webmonkey)....
  17. Does Anyone Know To Use Movabletype (perl) - (6)
    I can't fit my long title in the topic title so cont..impeccable knowdledge of Moveabletype 2.xx
    it's like so foriegn to me..I'm really new at this but I'm trying to make a blog and
    I'm so clueless..any help? thanx in advance...
  18. Perl Script - (0)
    Hey everyone, got a problem with a Perl script I'm trying out. In my Perl script, I have the
    user input a number to dynamically display a number of text form fields in which they enter figures.
    At the bottom, there will be a button to give the sum of all the numbers in the text
    fields--that's where I'm stuck, I got the text boxes to show up alright, but that's
    about it. I thought I might use JavaScript, but that didn't turn out to well. I was thinking of
    using arrays for the name referencing in the javascript part, but I couldn't figure that out e...
  19. Perl, the hacker language? - (6)
    For you why many times we associate Perl to the hacker's world?for many exploit write in perl or
    for the flexibility of the Lang, what do you think about? For me, Because in perl the operation on
    the strings and with the socket are powerful as in c but perl is simpler to write IMHO Byez &
    'njoy...
  20. Perl Text Safety - (1)
    How do you make inmput from a textarea html and perl safe?? like remove the / the tabs (\t)
    and linebrakes (\n) like the javascript escape command (so i can store it into a textfile that
    reads line by line inforation and uses /t as a seporater (I could use someting else as a seporater
    if that would make more sence )) Thanks for all your sujestions ...
  21. Crypto Program - A perl "script" to protect data (0)
    If you'd like to protect you doc without the standard program and algorithms you'll fide it
    useful, Now the only big problem is the ARRAY pased to the subs, in fact I can't pass 2 @ at
    the same Sub so I have to use a global array(@plus) in the subroutines, SomeOne knows if is it
    possibile to pass 2 @ to a sub? if yes how? CODE #!/usr/bin/perl #************Random
    Signature V1,0******************# #* CodeName: Crypto v1.7 alpha                     *# #*
    Coder: K22 - www.klakice.astahost.com;         *# #* Date: 07/11/2004;               ...



Looking for simple, problem, w, perl, world, script

Searching Video's for simple, problem, w, perl, world, script
advertisement




Simple Problem W/ Perl - I can't get this hello world script



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE