use strict; use warnings; use List::MoreUtils qw(any); my @strings = qw(abcd abbd efgh); print @strings if any {/(\w)\1/} @strings;