The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Locale::Object::Continent - continent information objects

DESCRIPTION

Locale::Object::Continent allows you to create objects representing continents, that contain other objects representing the continent in question's countries.

SYNOPSIS

    my $asia      = Locale::Object::Continent->new( name => 'Asia' );

    my $name      = $asia->name;
    my @countries = $asia->countries;

METHODS

new()

    my $asia = Locale::Object::Continent->new( name => 'Asia' );
    

The new method creates an object. It takes a single-item hash as an argument - the only valid options to it is 'name', which must be one of 'Africa', 'Asia', 'Europe', 'North America', 'Oceania' or 'South America'. Support for Antarctic territories is not currently provided.

The objects created are singletons; if you try and create a continent object when one matching your specification already exists, new() will return the original one.

name()

    my $name = $asia->name;
    

Retrieves the value of the continent object's name.

countries()

    my @countries = $asia->countries;

Returns an array of Locale::Object::Country objects with their ISO 3166 alpha2 codes as keys (see Locale::Object::DB::Schemata for more details on those) in array context, or a reference in scalar context. The objects have their own attribute methods, so you can do things like this:

    foreach my $place (@countries)
    {
      print $place->name, "\n";
    }
    

Which will list you all the currencies used in that continent. See the documentation for Locale::Object::Country for a listing of country attributes. Note that you can chain methods as well.

    foreach my $place (@countries)
    {
      print $place->currency->name, "\n";
    }

AUTHOR

Earle Martin <EMARTIN@cpan.org>

http://purl.oclc.org/net/earlemartin/

CREDITS

See the credits for Locale::Object.

LEGAL

Copyright 2003-2004 Fotango Ltd. All rights reserved. http://opensource.fotango.com/

This module is released under the same license as Perl itself, and is provided on an "as is" basis. The author and Fotango Ltd make no warranties of any kind, either expressed or implied, as to the accuracy and/or utility of any results obtained from its use. However, if you do find something wrong with the results, please let the author know. Thanks.