$pw = join('',@chars[map{rand @chars} (1..17)]; #### $pw = join '', map { $chars[ rand @chars ] } 1..17;