Changes for version 0.85 - 2026-08-27
- Bug Fixes
- Data::Validate::IP and NetAddr::IP moved from required to recommended; NetAddr::IP::UtilPP fails to build on Windows (mask4to6 bad-argument error), which cascades to Data::Validate::IP, crashing country() on import; a package-level $_have_dvip sentinel tries to load Data::Validate::IP once and, on failure, installs pure-Perl fallbacks (using Socket::inet_pton for IPv6 validation) as aliases for is_ipv4(), is_ipv6(), is_private_ip(), and is_loopback_ip() so the rest of country() is unchanged on both platforms
- _code2countryname(): when Locale::Object's database is absent, fall back to Locale::Codes::Country::code2country() via the new _country_short_name() helper; a %COUNTRY_SHORT_NAMES table overrides the ~15 codes where Locale::Codes returns the full ISO official name (e.g. "United Kingdom of Great Britain and Northern Ireland") instead of the common short form ("United Kingdom") — fixes sublanguage() returning 'Unknown' for en-gb and en-us on Windows CI where Locale::Object's SQLite database is not installed
- Locale::Object::Country->new() and Locale::Object::DB->new() now wrapped in eval at every call site; a package-level $_locale_object_db_ok sentinel (undef=unchecked, 0=absent, 1=present) prevents repeated failed attempts on systems where Locale::Object's SQLite database is missing — common on Windows CI runners where the .db file is not installed alongside the module; the module now degrades gracefully (sublanguage/country name returns 'Unknown' rather than dying) instead of propagating the "database was not in" exception
- Make Net::Subnet an optional (recommended) dependency rather than required; Net::Subnet depends on Socket6 which requires C compilation and fails to build on Windows; add a pure-Perl fallback (_in_baidu_subnet) for the single 185.10.104.0/22 check in _handle_eu_country so the module continues to detect Baidu crawler IPs even when Net::Subnet is absent
- _resolve_sublanguage_match(): second path (I18N::AcceptLanguage returns a full tag such as en-gb) now falls back to _country_short_name() before setting sublanguage to 'Unknown', fixing sublanguage() returning 'Unknown' for en-gb / en-us on Windows CI where Locale::Object's SQLite database is not installed
- time_zone(): DateTime::TimeZone::Local->TimeZone() wrapped in eval with local $SIG{__DIE__} so time_zone() returns undef gracefully on Windows Perl builds that install the module but omit the TimeZone() method
- Test Suite
- t/mutant_killers.t: three subtests that call ->name() on a Locale::Object result now probe the Locale::Object database first and SKIP if absent, preventing a "Can't call method 'name' on an undefined value" crash on Windows CI runners
Documentation
Modules
Create a multilingual web page