Locale::Object

Locale::Object is an object-oriented representation of locale information.
Download

Locale::Object Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Earle Martin
  • Publisher web site:
  • http://search.cpan.org/~emartin/WWW-Lipsum-0.2/lib/WWW/Lipsum.pm

Locale::Object Tags


Locale::Object Description

Locale::Object is an object-oriented representation of locale information. Locale::Object is an object-oriented representation of locale information.The Locale::Object group of modules attempts to provide locale-related information in an object-oriented fashion. The information is collated from several sources and provided in an accompanying DBD::SQLite database.At present, the modules are:Locale::Object - make compound objects containing country, currency and language objectsLocale::Object::Country - objects representing countriesLocale::Object::Continent - objects representing continentsLocale::Object::Currency - objects representing currenciesLocale::Object::Currency::Converter - convert between currenciesLocale::Object::DB - does lookups for the modules in the databaseLocale::Object::Language - objects representing languagesFor more information, see the documentation for those modules. The database is documented in docs/database.pod. Locale::Object itself can be used to create compound objects containing country, currency and language objects.SYNOPSIS use Locale::Object; my $obj = Locale::Object->new( country_code_alpha2 => 'gb', currency_code => 'GBP', language_code_alpha2 => 'en' ); $obj->country_code_alpha2('af'); $obj->country_code_alpha3('afg'); $obj->currency_code('AFA'); $obj->currency_code_numeric('004'); $obj->language_code_alpha2('ps'); $obj->language_code_alpha3('pus'); $obj->language_name('Pushto'); my $country = $obj->country; my $currency = $obj->currency; my $language = $obj->language; $obj->empty('language'); print $obj->sane('country'); $obj->make_sane( attribute => 'country' populate => 1 );METHODSnew() my $obj = Locale::Object->new( country_code_alpha2 => 'gb', currency_code => 'GBP', language_code_alpha2 => 'en' );Creates a new object. With no parameters, the object will be blank. Valid parameters match the method names that follow.country_code_alpha2(), country_code_alpha3() $obj->country_code_alpha2('af'); $obj->country_code_alpha3('afg');Sets the country attribute in the object by alpha2 and alpha3 codes. Will create a new Locale::Object::Country object and set that as the attribute. Because Locale::Object::Country objects all have single instances, if one has already been created by that code, it will be reused when you do this.country_code(), currency_code_numeric() $obj->currency_code('AFA'); $obj->currency_code_numeric('004');Serves the same purpose as the previous methods, only for the currency attribute, a Locale::Object::Currency object.language_code_alpha2(), language_code_alpha3(), language_name() $obj->language_code_alpha2('ps'); $obj->language_code_alpha3('pus'); $obj->language_name('Pushto');Serves the same purpose as the previous methods, only for the language attribute, a Locale::Object::Language object. Requirements: · Perl


Locale::Object Related Software