#!/usr/bin/perl -w use strict; my $source = join('', ); my @capgroups = grep { $_ } split(/(?:^|\s+)(?:[^A-Z]\S*\s*)+/, $source); foreach ( @capgroups ) { print "$_\n"; } __DATA__ Douglas built five Douglas World Cruisers to attempt his first flight to Buenos Aires. These were the predecesors of the modern AH-64D and AH-64D Apache.