On Sun, Jul 22, 2012 at 11:09:10PM +0200, Jenda Krynicky wrote: > From: Paul Johnson <p...@pjcj.net> > > You need a mixture of the two approaches: map to prepend "not in:" and > > join to join them. > > > > my $query = join " and ", map "not in:$_", @folders; > > > @folders = ('one', 'two'); > my $query = "not in:" . join( " and not in:", @folders); > print $query; > > will be quicker.
Maybe. But I'm not sure that's a particularly compelling argument. Better to aim for correctness, clarity and maintainability, wouldn't you think? > no need to map and join just because you need some > text even before the first value. That's a good point. -- Paul Johnson - p...@pjcj.net http://www.pjcj.net -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/