Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Expression form of map or grepby ForgotPasswordAgain (Priest) |
on Jul 12, 2020 at 00:03 UTC ( [id://11119190]=note: print w/replies, xml ) | Need Help?? |
FWIW, I agree with everything you said. However, I think you made a little error:
I think @list will not contain anything from @grey_scale, and would warn with something like "Useless use of private array in void context", because the assignment precedes the comma operator. I do prefer the expression form with parentheses, though, partly because of an (I believe) obsolete reason which was that the block form would generate a new lexical space whereas the expression form wouldn't, so the expression form was apparently slightly more performant (on very large lists). I also like making hashes with something like...
...I guess because it seems the most generally correct, given the possible parsing bugs with Perl and map, but at the same time I can see that it's possibly confusing, especially given the "array in void context" comment above. :)
In Section
Meditations
|
|