BEGIN { my @source = ('A'..'Z', 'a'..'z', '0'..'9'); sub generate_random_password { my $id = ""; for (1..18) { $id .= $source[rand @source]; } $id; } }