sub longest_words { my @W = $_[0] =~ /\b(\w+)\b/g; my $L = 0; $L = length() < $L ? $L : length for @W; grep length == $L, @W; }