while () { my $pw = @chars[map{rand @chars} (1..17)]; } unless ($_ ne $usedpw) { print "Your unique ID is: $pw\n"; } #### while () { my $pw = @chars[map{rand @chars} (1..17)]; } unless ($_ ne $usedpw) { print "Your unique ID is: $pw\n"; } #### print "Your unique ID is: $pw\n" if $_ eq $usedpw;