The code assumes that the original string comes from STDIN and the final strings goes to STDOUT. I presume you'll have no problem adapting it to your real needs.$a=<>; while ($a=~s/(\s?)(\w{10})(\w)/$1$2 $3/){} $a=~s/((\w+\s){5})/$1\n/g; print $a,"\n";
In reply to Re: spliting a lengthy text
by themage
in thread splitting and coloring
by sanku
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |