in reply to Capitalization Clusters

Well ... given all the good comments above, one brute force ugly way is:

#/usr/bin/perl $sentence = "Douglas built five Douglas World Cruisers to attempt his +first flight to Buenos Aires. These were the predecesors of the moder +n AH-64D and AH-64D Apache."; # split on spaces and some common punctuations @words = split( /\s+|[.,\/\\;]/, $sentence ); # roll through the words and grab the cap words # and their position $cnt = 0; foreach( @words ) { push( @lol, [ $_, $cnt ] ) if /^[A-Z]/; $cnt++; } # print out the first match $prev = $lol[0]->[1]-1; print $lol[0]->[0]; shift( @lol ); # roll through the rest. print out a new line # if it's not the next word by count, space if it is foreach( @lol ) { print $prev != $_->[1]-1 ? "\n" : " "; print $_->[0]; $prev = $_->[1]; } print "\n";

Like I said ... ugly.

-derby