You could look at the poll results of

"If I was forced to use only one kind of loop for the rest of my days it would be a ...."

Perhaps a link would help, since the person you're responding to is a PM newbie.

It could help you better in what monks feel the most powerful loop.
If this is supposed to be sarcastic, then fine. If it's not, then I doubt it would really help. In particular the most voted option has been (as of this writing): "matter of time 'til I killed the bastard who forced me to do it".

Indeed the joke does stress that TMTOWTDI rules. More seriously, the two most often used loops in Perl are IMO while and for. Matter is they excel in two different kind of loops. Typically, but not exclusively of course, the former for iterating over filehandles (such a typical operation in Perl!) and the latter over fixed length lists -- but beware of redo, last and next!

Incidentally we may note here that in Perl6 we will have for commonly used for both kind of situations, with the help of lazy lists and similar magic...

prad

PERL is the only language i know and i dont want to know the rest.

Is this supposed to be a .sig? Then you should do us all a favour and render it in a visually distinctive manner, e.g. a smaller font, to help us not be distracted by it and consider it part of your actual post.

BTW: quite sad that such a claim is about "PERL", especially since there's not such a thing. Please check

perldoc -q 'difference between "perl" and "Perl"'
(also available here.)

In reply to Re^3: seeking advice on loops by blazar
in thread seeking advice on loops by sierrastar

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.