my $has_date = grep /^d/ && (/a/+/t/+/e/) == 3, @words; my $has_publish = grep /^p/ && (/u/+/b/+/l/+/i/+/s/+/h/) >= 5, @words;