while (1) { my @chars = ( "A" .. "Z", "a" .. "z", 0 .. 9, qw(! @ $ % ^ & *) ); if ($usedpw ne m/$pw/) { print "Your unique password is: $pw\n"; } }