@words=$text_body =~ /(\S+)/g; #compute $start and $end $newtext=join(" ",@words[$start..$end]);