print "| $_ |\n" for map substr($_ . ' ' x 16, 0, 16), $s =~ m[(.{1,16})(?:\s+|$)]g; # ^^ ^^^^^^^^^