Just another Perl shrine | |
PerlMonks |
Re: map and grep or clear code?by choroba (Cardinal) |
on Jan 31, 2012 at 10:16 UTC ( [id://950927]=note: print w/replies, xml ) | Need Help?? |
I would use grep, but remove the and $filter_clean from inside its condition. If you really want to check it, do it just once before running grep, repeating it when the variable does not change is useless. Also, map returns a list, but you want to concatenate a string, so use join. If you add numbers to your %filter_map (e.g. by ), you can simplify it to which seems pretty clear to me.
In Section
Seekers of Perl Wisdom
|
|