idiomatic perl - for(each), map, grep