Site Tools


perl:codes:namegenerator

Namegenerator

Sometimes I dont feel like using my real name because I have to ask a stupid question in a forum. I sit there and think about a name for ages…
I wrote this script to generate a random name so I dont have to think about names anymore.
To use this, simply select your gender and double click enter/return. The time between the start and the clicks will generate random numbers so you wont get the same name over and over.
ATTENTION: Iam german, thats why I use german names. Edit them if you need to.

#!/usr/bin/perl -w
 
###################################
########10.02.2015 19:14 pm########
###################################
#########Made by Lunetikk##########
###################################
#####Use: start, choose gender#####
#####double click enter/return#####
###################################
 
#firstnameMale, firstnameFemale and lastname array
@vornamem = ("Armin","Achim","Arnold","Benedikt","Benjamin","Boris","Berthold","Barney","Charlie","Detlef","Dieter","Emil","Ernst","Fritz","Frank","Gerhard","Gerold","Heinrich","Heinz","Harald","Heiner","Ingolf","Jonas","Jakob","Jens","Jan","Janis","Jonathan","Joachim","Johannes","Klaus","Karsten","Karl","Lennard","Moritz","Marvin","Markus","Manfred","Nils","Norbert","Oliver","Olaf","Paul","Patrick","Quentin","Ralf","Reiner","Roland","Simon","Sebastian","Thomas","Thorben","Thorsten","Ulf","Uwe","Ulrich","Werner","Wolfgang","Xavier","Xaver","Yannik","Zacharias");
 
@vornamef = ("Angela","Armanda","Amelie","Anna","Anne","AnnKatrin","Anja","Bettina","Beate","Betty","Bianca","Carmen","Carola","Carolin","Caroline","Carla","Dora","Doris","Doria","Dagmar","Emma","Emilia","Emanuela","Frederike","Fabienne","Florence","Gaby","Gabriele","Hermine","Hella","Ina","Inja","Ines","Inge","Jana","Jeanette","Janine","Janina","Jasmin","Jasmine","Klara","Kerstin","Kirsten","Kristina","Kamilla","Lena","Laura","Luise","Luisa","Martina","Marion","Monika","Milena","Melanie","Melissa","Mareike","Maria","Nele","Nora","Nadine","Olivia","Paula","Ronja","Sybille","Sylvia","Sabrina","Svenja","Sonja","Sonya","Tanja","Tanya","Tabea","Ulrike","Vera","Viola","Verena","Yvonne","Yana","Zora");
 
@nachname = ("Arnold","Arndt","Ampft","Bender","Boehm","Bechthold","Berthold","Dachs","Doehler","Dachner","Ems","Federer","Feuer","Gans","Gunther","Gieselmann","Heinrich","Heizelmann","Hinz","Immel","Insel","Ingwer","Jansen","Kunz","Klement","Karst","Kummer","Kling","Klinge","Kamp","Kramer","Kammerer","Lange","Langer","Langhans","Lenz","Lampert","Lammer","Lorenz","Mustermann","Meier","Meyer","Maier","Mayer","Neumann","Niedermeier","Niedermeyer","Niedermayer","Niedermaier","Neuer","Nagel","Ohlheiser","Ohr","Penzer","Panzer","Paul","Pech","Plump","Rost","Roessler","Reimann","Reihmann","Roemer","Simon","Saenger","Schmitt","Schmidt","Schmied","Schneider","Stein","Seifert","Sommer","Tillmann","Tilmann","Uhrmann","Uhrmacher","Ulmen","Veit","Volkner","Voelkner","von der Heide","Woerner","Werner","Wiesmann","Weiler","Zimmermann","Zacher","Zielmann");
 
print "Male or Female? (m/f)";
chomp ($gender = <STDIN>);
 
if ($gender eq "m")
{
 
   use Term::ReadKey;
 
   $elementevornamem = @vornamem; #get number of elements from array firstname
   $elementenachname = @nachname; #get number of elements from array lastname
 
   ReadMode 4; # Turn off controls keys
      while (not defined ($key = ReadKey(-1))) {
 
         $zahl=int(rand($elementevornamem)+1); #generate number
         $firstnameoutput = $vornamem[$zahl];
 
      }
 
   ReadMode 4; # Turn off controls keys
      while (not defined ($key = ReadKey(-1))) {
 
         $zahl1=int(rand($elementenachname)+1); #generate another number
         $lastnameoutput = $nachname[$zahl1];
 
      }
}
 
else {
 
   use Term::ReadKey;
 
   $elementevornamef = @vornamef; #get number of elements from array firstname
   $elementenachname = @nachname; #get number of elements from array lastname
 
   ReadMode 4; # Turn off controls keys
      while (not defined ($key = ReadKey(-1))) {
 
         $zahl=int(rand($elementevornamef)+1); #generate number
         $firstnameoutput = $vornamef[$zahl];
 
      }
 
   ReadMode 4; # Turn off controls keys
      while (not defined ($key = ReadKey(-1))) {
 
         $zahl1=int(rand($elementenachname)+1); #generate another number
         $lastnameoutput = $nachname[$zahl1];
 
      }
}
 
print $firstnameoutput . " " . $lastnameoutput; #print the first+lastname
 
ReadMode 0; # Reset tty mode before exiting



perl/codes/namegenerator.txt · Last modified: 2018/12/20 17:45 by lunetikk