if ( $word =~ /([\Q$word\E])(?=.*\1)/ ) { print "$word is NOT an isogram.\n"; } else { print "$word is an isogram.\n"; }