in reply to My favorite looping mechanism in Perl is:

What about map?
  • Comment on RE: My favorite looping mechanism in Perl is:

Replies are listed 'Best First'.
RE: map is not a choice
by turnstep (Parson) on May 12, 2000 at 18:39 UTC
    Perhaps because map is not a looping mechanism in that you cannot break out of it by satisfying a test or by using 'last'. Technically, "goto" and "what?" are not really looping mechanisms either, and "for" and "foreach" are the same, which leaves only "while" and "for". Of course, we could add "anonymous" loops (blocks) as well, which don't have a test but can use last/next/redo. Maybe we could stretch things a bit and have a fourth entry of "do/while"...