Locale::Object::Continent - continent information objects
0.24
Locale::Object::Continent allows you to create objects representing continents, that contain other objects representing the continent in question's countries.
Locale::Object::Continent
my $asia = Locale::Object::Continent->new( name => 'Asia' ); my $name = $asia->name; my @countries = $asia->countries;
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.
new
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"; }
Earle Martin <EMARTIN@cpan.org>
See the credits for Locale::Object.
Copyright 2003 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.
To install Locale::Object, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Locale::Object
CPAN shell
perl -MCPAN -e shell install Locale::Object
For more information on module installation, please visit the detailed CPAN module installation guide.