#!/usr/bin/perl -l use warnings; use strict; my $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.'; # What do you call a capitalized "word"? my $cap_word = qr/[A-Z][\w-]*/; my @clusters = $data =~ / #(? length $a } @clusters)[0];