in reply to map vs. foreach

From a style standpoint, I consider foreach to generally be better than map. For this particular problem, I would use
print join("\n", @fields), "\n";
rather than a map or foreach.