say foreach (grep /test$/, @names); map { /test$/ and say } @names;