On Tue, Sep 30, 2014 at 6:19 PM, David Precious <dav...@preshweb.co.uk> wrote:
> Like most things, TIMTOWTDI, but I believe Perl Best Practices [PBP] > advises > against using map in void context. > As PBP[1] is encoded in Perl::Critic map and grep are intended to be pure functions, not mutators. If you want to iterate with side-effects, then you should use a proper for or foreach loop. Somewhere there's a quote (possibly apocryphal but wait! [2]) from Larry Wall on a map vs foreach thread: "That being said, I'd never grep someone in a void context myself." He actually wasn't condemning the use of map/grep in a void context per se, just noting his personal preference. a [1] Perl Best Practices Standards and Styles for Developing Maintainable Code By Damian Conway <http://shop.oreilly.com/product/9780596001735.do#tab_04_2> http://shop.oreilly.com/product/9780596001735.do [2] quoted here: http://www.perlmonks.org/?node_id=809543 Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk