@chars = ( "A" .. "Z", "a" .. "z", 0 .. 9, qw(! @ $ % ^ & *) ); $unique_key = join("", @chars[ map { rand @chars } ( 1 .. 31 ) ]);