use strict; use warnings; my $secret = \"AA"; close STDIN; open STDIN, '<', $secret or die $!; print "Enter a string that will match the secret matching pattern \n"; chomp (my $selection = ); if ($selection =~ m/(.)\1/) { print "The match was perfect \n"; } else { print "Match not found \n"; } #### Enter a string that will match the secret matching pattern The match was perfect