# Copies to a second array while formatting. my @formatted = map { sprintf($format, $_) } @array;