my @test = qw/abc aab abb aba/; for (@test) { say if not /(.).*?\1/; }