in reply to splitting and coloring

Hi sanku,

I think that this code does what you need:
$a=<>; while ($a=~s/(\s?)(\w{10})(\w)/$1$2 $3/){} $a=~s/((\w+\s){5})/$1\n/g; print $a,"\n";
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.