Created
December 18, 2012 12:49
-
-
Save memowe/4327686 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# generate cool names | |
sub rand_name { | |
# split alphabet characters | |
my @vovels = qw(a e i o u); | |
my @consonants = grep {not $_ ~~ @vovels} 'a' .. 'z'; | |
my %chars = (a => \@vovels, p => \@consonants); | |
# build name by template | |
my @templates = qw(papa paapa pappa papaa apa pap paap pappa); | |
my $template = @templates[rand @templates]; | |
(my $name = $template) =~ s/./ ${$chars{$&}}[rand @{$chars{$&}}] /eg; | |
return $name; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment