NAME

Benchmark::Featureset::LocaleCountry - Compare Locale::Codes, Locale::Country::Multilingual, WWW::Scraper::Wikipedia::ISO3166, etc

Synopsis

#!/usr/bin/env perl

use strict;
use warnings;

use Benchmark::Featureset::LocaleCountry;

# ------------------------------

Benchmark::Featureset::LocaleCountry -> new -> run;

See scripts/locale.report.pl.

Hint: Redirect the output of that script to your $doc_root/locale.report.html.

View the report on my website.

Description

Benchmark::Featureset::LocaleCountry compares some features of various modules:

o Locale::Codes
o Locale::Country::Multilingual
o Locale::Geocode
o Locale::Object
o Locale::SubCountry
o WWW::Scraper::Wikipedia::ISO3166

Distributions

This module is available as a Unix-style distro (*.tgz).

See http://savage.net.au/Perl-modules/html/installing-a-module.html for help on unpacking and installing distros.

Installation

The Module Itself

Install Benchmark::Featureset::LocaleCountry as you would for any Perl module:

Run:

cpanm Benchmark::Featureset::LocaleCountry

or run:

sudo cpan Benchmark::Featureset::LocaleCountry

or unpack the distro, and then either:

perl Build.PL
./Build
./Build test
sudo ./Build install

or:

perl Makefile.PL
make (or dmake or nmake)
make test
make install

The Configuration File

All that remains is to tell Benchmark::Featureset::LocaleCountry your values for some options.

For that, see config/.htbenchmark.featureset.localecountry.conf.

If you are using Build.PL, running Build (without parameters) will run scripts/copy.config.pl, as explained next.

If you are using Makefile.PL, running make (without parameters) will also run scripts/copy.config.pl.

Either way, before editing the config file, ensure you run scripts/copy.config.pl. It will copy the config file using File::HomeDir, to a directory where the run-time code in Benchmark::Featureset::LocaleCountry will look for it.

shell>cd Benchmark-Featureset-LocaleCountry-1.00
shell>perl scripts/copy.config.pl

Under Debian, this directory will be $HOME/.perl/Benchmark-Featureset-LocaleCountry/. When you run copy.config.pl, it will report where it has copied the config file to.

Check the docs for File::HomeDir to see what your operating system returns for a call to my_dist_config().

The point of this is that after the module is installed, the config file will be easily accessible and editable without needing permission to write to the directory structure in which modules are stored.

That's why File::HomeDir and Path::Class are pre-requisites for this module.

All modules which ship with their own config file are advised to use the same mechanism for storing such files.

Constructor and Initialization

new() is called as my($builder) = Benchmark::Featureset::LocaleCountry -> new(k1 => v1, k2 => v2, ...).

It returns a new object of type Benchmark::Featureset::LocaleCountry.

Key-value pairs in accepted in the parameter list (see corresponding methods for details):

o (None as yet)

Methods

build_country_data()

Returns an arrayref of module names and country counts.

build_environment()

Returns an arrayref of stuff about my working environment.

build_mismatched_countries()

Returns an arrayref of mismatches between modules and the country names they use.

build_mismatched_division_list()

See build_mismatched_divisions().

build_mismatched_divisions()

Returns an arrayref of mismatches between modules and the division names they use.

Uses build_mismatched_division_list() to do the work.

build_module_data()

Returns:

o An object of type Set::Array, called $common_countries

This holds the list of countries which all modules have in common.

o A hashref called $module_data

This is the hashref of the modules being tested.

o An arrayref called $module_list

This is for outputting. It contains the modules' names and links to CPAN.

build_purpose()

Returns an arrayref of stuff about the purpose of this module.

build_templater()

Returns an object of type Text::Xslate.

new()

For use by subclasses.

run()

Does the real work.

See scripts/locale.report.pl.

Hint: Redirect the output of that script to $doc_root/locale.report.html.

References

The modules compared in this package often have links to various documents, which I won't repeat here...

Machine-Readable Change Log

The file CHANGES was converted into Changelog.ini by Module::Metadata::Changes.

Version Numbers

Version numbers < 1.00 represent development versions. From 1.00 up, they are production versions.

Support

Email the author, or log a bug on RT:

https://rt.cpan.org/Public/Dist/Display.html?Name=Benchmark::Featureset::LocaleCountry.

Author

Benchmark::Featureset::LocaleCountry was written by Ron Savage <ron@savage.net.au> in 2011.

Home page: http://savage.net.au/index.html.

Copyright

Australian copyright (c) 2011, Ron Savage.

All Programs of mine are 'OSI Certified Open Source Software';
you can redistribute them and/or modify them under the terms of
The Artistic License, a copy of which is available at:
http://www.opensource.org/licenses/index.html