6 Einträge, 1 Seite |
QuoteLarry Wall (<larry {at} wall.org>)
Re: grep/map in void context
1999/11/01
perl.porters-gw
The argument against using an operator for other than its primary
purpose strikes me the same as the old argument that you shouldn't have
sex for other than procreational purposes. Sometimes side effects
are more enjoyable than the originally intended effect.
QuoteBoth grep and map build a return list, regardless of their context. This means you're making Perl go to the trouble of building up a return list that you then just ignore. That's no way to treat a programming language, you insensitive scoundrel!
Taulmarill+2008-08-05 23:31:40--Andere, die versuchen den Code zu verstehen, könnten sonst an dem unüblich eingesetzten map hängen bleiben und unnötig lange darüber grübeln, warum das jetzt da ist und ob man den Sinn der Konstruktion evtl. missgedeutet hat.
6 Einträge, 1 Seite |