$|=1; # So it works in the IDE

@s = qw /nanana onion Mississippi dodo anna/;

foreach $e (@s){
  if ($e =~ /(\w\w)\w+\1/){       # use \1 to back-reference 2 matched characters
    print "$e matches!\n";
  }
  else {
    print "$e doesn't match!\n"
  }
}
