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. Advertising

  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. Advertising

  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. Advertising

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. Jerry C.
    Replies:
    8
    Views:
    252
    Uri Guttman
    Nov 23, 2003
  2. Kruno Saho
    Replies:
    0
    Views:
    147
    Kruno Saho
    Apr 7, 2013
  3. Dave Angel
    Replies:
    0
    Views:
    128
    Dave Angel
    Apr 7, 2013
  4. rusi
    Replies:
    0
    Views:
    115
  5. Miki Tebeka
    Replies:
    0
    Views:
    86
    Miki Tebeka
    Apr 7, 2013
Loading...

Share This Page