sub random_alignment { my $type = shift; $type eq "parts" and return $parts[rand @parts]; $type eq "good_vs_evil" and return $good_vs_evil[rand @good_vs_evil]; $type eq "lawful_vs_chaotic" and return $lawful_vs_chaotic[rand @lawful_vs_chaotic];