First, points for trying to write your first Perl program on the command line (Terminal). Since you're already there here are a few commands to begin reading the documentation:

In addition to the good advice already provided to you, in terms of using a "Programmer's" text editor, there are some nice choices on the Mac. You can try out Vi right away as Corion suggested. It's a little strange at first but a perfect way to start is going back to the Terminal and enter vimtutor. You'll then be prompted to hit enter/return. This interactive tutorial takes about half an hour and is REALLY worth the time. You can also download a GUI version of Vim for the Mac called MacVim and have access to some helpful plugins for programming Perl.

There is also BBEdit, which I've used for a while and really like. It's pricey (especially compared to Vi ($99.99 US) but there's a free trial as well as a basic version called Text Wrangler.

Good luck and have fun.

"...the adversities born of well-placed thoughts should be considered mercies rather than misfortunes." — Don Quixote

In reply to Re: Falling at the first hurdle by luis.roca
in thread Falling at the first hurdle by jfxd500

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.