I type in 'perl name.plx'

In this case, it doesn't matter what path you put in the shebang/#!/first line, though the options still matter - perl will process them. You can (and probably should) read more in perlrun.

You may know that if you set execute permission on your script file you can run it with './name.plx' if it is in your current working directory or simply 'name.plx' if it is in one of the directories in your path. This can be convenient, but isn't necessary. If you want this to work, then you will have to have the path to your perl program in the first line, or use one of the "tricks" mentioned in perlrun.

I hope you start using "use strict" and "use warnings". You might have a look at perllexwarn to learn more about what they do and how to control them (sometimes you want to do things without the warnings or compilation errors).

If you want to print "Hello world" 20 times, use while instead of if, but TMTOWTDI. I might write your program something like this:

use strict; use warnings; print "Hello World!\n" for (1..20); print "Wait, that's it?\n";

In reply to Re^2: It LOOKS right... by ig
in thread It LOOKS right... by BIOM01

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.