in reply to string length problems

Just found another nice solution:
$window=79; $str="X" x 723; print join "\n", unpack "A$window" x ((length($str)+$window-1)/$window +), $str;
String is split by unpack into enough pieces of $window length. "A$window" is the pattern for one piece. This is multiplied by (length($str)+$window-1)/$window.
the resulting array is then joined with "\n";