print $1,"\n" while $text =~ /([^\n]{0,$max_line_size}})\n?/g;