I agree, and that's why I like, in particular, the for-loop and, less so, map (and let's just pass over the grep) versions that iterate over ranges of 1 .. $#array or 0 .. $#array-1 and so will never enter the loop
The problem with the map/grep and postfix for is that they generate a list as big as the array.
Small lists: meh! But for big lists -- where big frequently is in the 100s of millions on my machine and billions on client/AWS X1 instances -- those lists cost big time.
Postfix while and until avoid that whilst still giving clean, concise code. Combined with each, its good for big hashes also.
In reply to Re^5: Abusing Map
by BrowserUk
in thread Abusing Map
by writch
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |