The "loop flow modification" keywords in Perl are "redo", "next", and "last" because they allow you to "redo" the loop for the same input, skip to the "next" input, or make this the "last" input. "break" doesn't fit the pattern. You'll also note that Perl's == vs. eq is very much like /bin/test's = vs. -eq except that in Perl, eq is for strings while with /bin/test -eq is for numbers. But it makes more sense to use the "stringy" eq for strings.
Larry took ideas from a lot of languages and tools in writing Perl. But he also improved on many of these ideas. "break" isn't a very descriptive name for a keyword. C doesn't have "redo" nor "next" loop flow modification. In this case Perl chose to be consistant with itself over being consistant with C. This is a good thing IMHO. (:
- tye (but my friends call me "Tye")In reply to (tye)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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |