Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re^4: Unhappy returnsby Aristotle (Chancellor) |
on Oct 10, 2005 at 14:33 UTC ( [id://498814]=note: print w/replies, xml ) | Need Help?? |
The difference is that foreach is a statement, and as such does not return anything. The context in which its body is evaluated is therefore never of any interest, any more than it is of interest which context the body of an if or while is evaluated in. map and grep OTOH are expressions and do return something; which means context is paramount. Makeshifts last the longest.
In Section
Meditations
|
|