in reply to The last command is like the break statement in C
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")
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jcwren) RE: (tye)Re: The last command is like the break statement in C
by jcwren (Prior) on Sep 27, 2000 at 18:46 UTC | |
by tye (Sage) on Sep 27, 2000 at 19:00 UTC | |
by tilly (Archbishop) on Sep 27, 2000 at 19:43 UTC |