View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Dave Rolsky > Data-Random-Contact-0.05 > Data::Random::Contact



Annotate this POD


Open  1
View/Report Bugs
Module Version: 0.05   Source  


Data::Random::Contact - Generate random contact data


version 0.05


    use Data::Random::Contact;

    my $randomizer = Data::Random::Contact->new();

    my $person       = $rand->person();
    my $household    = $rand->household();
    my $organization = $rand->organization();


This module is still alpha, and the API may change in future releases.

This module generates random data for contacts. This is useful if you're working an application that manages this sort of data.

It generates three types of contacts, people, households, and organizations.


The data that this module uses comes from several sources. Names are based on data from Fake Name Generator ( This data is dual-licensed under GPLv3 or CC BY-SA 3.0 (United Stated). See for licensing details.

The address data is all real addresses from the website ( This data is licensed under the CC BY-NC-SA 3.0 (United Stated) license.

All other data is generated algorithmically.

Whether a license can apply to things like addresses and names is debatable, but I am not a lawyer.


This module provides just a few public methods:


This constructs a new object. It accepts two optional parameters:


This returns a random set of data for a single person.

See "RETURNED DATA" for details.


This returns a random set of data for a single household.

See "RETURNED DATA" for details.


This returns a random set of data for a single organization.

See "RETURNED DATA" for details.


Each of the methods that return contact data returns a complicated hashref-based data structure.

Shared Data

Some of the data is shared across all contact types:

All contact types return email, phone, and address data. This data is available under the appropriate key ("email", "phone", or "address") in the top-level data structure.

Under that key the data is further broken down by type, which will be something like "home", "work", "office", etc. Every contact will have all the valid keys set. In other words, a person will always have both a home and work email address.

The email data will always be at one of these domains:,,,, or

The phone number will be a string containing all the phone number data.

Each address is further broken down as a hashref data structure.

See the appropriate language module for details on phone numbers and addresses.

Here's an example of the shared data for a person (using US data):

        address => {
            home => {
                city        => "Reno",
                postal_code => 89503,
                region      => "Nevada",
                region_abbr => "NV",
                street_1    => "501 W. 1st St.",
                street_2    => undef
            work => {
                city        => "Minneapolis",
                postal_code => 55406,
                region      => "Minnesota",
                region_abbr => "MN",
                street_1    => "2823 E. Franklin Avenue",
                street_2    => undef
        email => {
            home => "charlotte.t.dolan\",
            work => "charlotte0\"
        phone => {
            home   => "508-383-7535",
            mobile => "775-371-7227",
            work   => "602-995-6077"

Person Data

Since much of this data is language-specific, you should see the appropriate language module for details. Some keys may be undefined, depending on the language.

The data for a person includes:

Household Data

The data for a person includes:

Organization Data

The data for a person includes:

Data Dumps

Here are complete data dumps for each contact type:


Dave Rolsky <>


This software is Copyright (c) 2011 by Dave Rolsky.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)
syntax highlighting: