... one could write: %newhash = map {yield transform_key($_); transform_val($_)} %oldhash; This flattens the %oldhash to a sequence of key/value pairs