Name Generator

By Ziddykins on May 15, 2014

Uploading a bunch of simple stuff done for a programming challenge.

#!/usr/bin/perl
use warnings; use strict;
use LWP::Simple;

my $fname = 'http://deron.meranda.us/data/popular-both-first.txt';
my $lname = 'http://deron.meranda.us/data/popular-last.txt';
my @lastn = split('\n', get($lname));
my @firstn = split('\n', get($fname));
my $indexF = int(rand(scalar @firstn));
my $indexL = int(rand(scalar @lastn));
print ucfirst(lc($lastn[$indexL])) . ", " . ucfirst(lc($firstn[$indexF])) . "\n";

Comments

Sign in to comment.
Hawkee   -  May 17, 2014

Some nice perl examples. It's been years since I've done any perl.

dma  -  Jan 08, 2016

OZNOID!!!! PLEASE

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.