I came across this statement in the Perl documentation
last cannot be used to exit a block which returns a value such as eval {} , sub {} or do {} , and should not be used to exit a grep() or map() operation.
Does anyone have any explanation as to why I cannot/should not use last to exit a grep() or map() operation?
More to the point, how to I go about exiting a map or grep operation?
Any suggestions or insights into why this is would be greatly appreciated! My greater understanding of map() isn't all that good.
Thanks!
Matt
In reply to Ways to control a map() operation by Booger
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |