First of all, welcome to the Monastery!

Second, as Corion already remarked, this smells like homework, and Perl 101 homework at that; and as a general rule the Monastery will not do your homework for you, though it will of course help you if you're stuck. This is primarily because we're a bunch of lazy bastards (hey, it's one of the three cardinal virtues!), but it's also for your own benefit. The only way to learn Perl is to write Perl, and if you give up this early on in your journey, how will you ever get anywhere?

So, let this post encourage you. Don't give up! Learning programming may appear daunting when you're getting your feet wet for the first time, but you can do it. And Perl is a friendly language that works for and with you, not against you, and that tries hard to do the right thing instead of weaseling out on technicalities, as some other languages like to do.

Now, for your particular task, here's some links that may help. Input/output is covered in the I/O Operators section of perlop. For performing a task a certain number of times, refer to Compound Statements in perlsyn. perldata has more on lists. Perl's documentation is excellent in general, and although it's very exhaustive and covers many details that may not be of interest to you (yet), I highly recommend it. There's gold in them thar hills, as it were.

I also recommend both Beginning Perl and Learning Perl as introductions to Perl, and Programming Perl as a general reference. If you're a student, your school's library may well have copies. (And if not, suggest buying them!)

Finally, not to toot my own horn, but my home node has links to all sorts of material, for new and experienced users alike. It's a work in progress, but you may still find it useful.

All the best, and have fun with Perl!


In reply to Re: Readin 10 numbers from the user by AppleFritter
in thread Readin 10 numbers from the user by Anonymous Monk

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.