newbie question

Discussion in 'Perl Misc' started by John Bokma, Mar 23, 2005.

  1. John Bokma

    John Bokma Guest

    usr wrote:

    > hi
    > I feel embarrassed to ask this question


    Reduce this feeling by reading:
    <http://www.catb.org/~esr/faqs/smart-questions.html>

    Quite some questions here are newbie questions, no need to state this
    (it's often clear from the rest of the message).

    > I'm using linux and this is my code
    > /usr/bin/perl
    > print "Hello, World!\n";
    > I then
    > chmod a+x program_name
    > then
    > ./program_name
    > then the terminal screen just sits until I stop it.


    Change the first line to:

    #!/usr/bin/perl

    > Thanks,
    > please enter giggles and restraind laughter were you see fit.


    No giggles, but a sound advice: read a good book on Perl (Learning
    Perl), read it front to back, and then start at the beginning again. The
    first time: *don't* sit behind a computer. The second time, yes. And
    make sure you make notes the second time you read it :-D.

    A little extra: make sure you put the following two lines under the
    first line:

    use strict;
    use warnings;

    The latter "replaces" the -w one can see now and then after the /perl in
    the first line.

    --
    John Small Perl scripts: http://johnbokma.com/perl/
    Perl programmer available: http://castleamber.com/
    Happy Customers: http://castleamber.com/testimonials.html
     
    John Bokma, Mar 23, 2005
    #1
    1. Advertisements

  2. usr <> wrote:

    > I'm using linux and this is my code
    > /usr/bin/perl
    > print "Hello, World!\n";



    #!/usr/bin/perl
    print "Hello, World!\n";


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
     
    Tad McClellan, Mar 23, 2005
    #2
    1. Advertisements

  3. Tad McClellan <> writes:
    > usr <> wrote:
    >
    > > I'm using linux and this is my code
    > > /usr/bin/perl
    > > print "Hello, World!\n";

    >
    >
    > #!/usr/bin/perl
    > print "Hello, World!\n";


    Just adding some information: what happened when the #! sequence
    wasn't present was that the program /usr/bin/perl was called in the
    ordinary way from the script. And when called without any arguments,
    it just sits and waits for input (on standard input, not from the
    script being executed) to treat as Perl code and execute.
     
    Arndt Jonasson, Mar 23, 2005
    #3
  4. John Bokma

    usr Guest

    hi
    I feel embarrassed to ask this question but I'm pretty new to this and
    can't seem to get it.
    Right here it is, How do I get the program 'Hello, World!' to run.
    I'm using linux and this is my code
    /usr/bin/perl
    print "Hello, World!\n";
    I then
    chmod a+x program_name
    then
    ../program_name
    then the terminal screen just sits until I stop it.
    Thanks,
    please enter giggles and restraind laughter were you see fit.
     
    usr, Mar 24, 2005
    #4
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jenny

    dotnet newbie question

    Jenny, Jul 13, 2003, in forum: ASP .Net
    Replies:
    9
    Views:
    1,361
    K_Lee
    Nov 6, 2003
  2. Alan S.

    Re: A newbie .NET question

    Alan S., Sep 4, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    977
    Jerry Dennany
    Sep 26, 2003
  3. Id0x
    Replies:
    4
    Views:
    1,418
    Erik Max Francis
    Jul 21, 2003
  4. cjl
    Replies:
    3
    Views:
    1,141
    John Nagle
    May 21, 2007
  5. JohnE

    newbie with newbie questions

    JohnE, Aug 17, 2009, in forum: ASP .Net
    Replies:
    3
    Views:
    743
    Gregory A. Beamer
    Aug 17, 2009
  6. Jerry C.
    Replies:
    8
    Views:
    545
    Uri Guttman
    Nov 23, 2003
  7. moonhkt
    Replies:
    2
    Views:
    336
    Chris Angelico
    Sep 16, 2012
  8. Dennis Lee Bieber

    Re: Newbie to python. Very newbie question

    Dennis Lee Bieber, Apr 7, 2013, in forum: Python
    Replies:
    1
    Views:
    147
    Miki Tebeka
    Apr 8, 2013
Loading...