Thanks. I forgot about "continue" in C, which I don't recall ever using. But this strengthens the story...

Now that Perl has "redo" and "next", both of these "continue" the loop processing so they really both had to be named something other than "continue". Plus, Perl lets you write for(a;b;c) as a;while(b){}continue{c} (I hope I got that right). It makes sense to use "continue" here since that block is what is executed whenever you decide to continue looping. So having "continue" introduce that block as well as be a loop flow modifier would probably lead to more parsing confusion. So we had to rename "continue", we might as well rename "break" as well.

I also wondered if "break" was being saved for when Perl adds a real "case" statement. I hate this in C:

while( bool ) { switch( input ) { case END: break; } }
What I really want to do is break out of the while loop. The work-arounds for this overloading of "break" in C are usually a bit ugly (depending on the specifics). So if Perl uses "break" for "case" statements, then I could code "last" above and get what I often want very easily.

        - tye (but my friends call me "Tye")

In reply to (tye2)Re: The last command is like the break statement in C by tye
in thread The last command is like the break statement in C by princepawn

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.