while ($name =~ /\s/g) { substr($name, $-[0], 1, "\n") if ++$i % 4 == 0; pos($name) = $-[0] + 1; }