in reply to Counting characters in a string

perl -pe'$_=join"\n",/.{0,5}/g'

Update 20040205 @ 1020 US/CST: or

perl -pe's/(.{1,5})/$1\n/g'

which is even shorter...



Christopher E. Stith