Skip Menu |

This queue is for tickets about the Locales CPAN distribution.

Report information
The Basics
Id: 69970
Status: resolved
Priority: 0/
Queue: Locales

People
Owner: Nobody in particular
Requestors: dmuey [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: TODO 0.18: aliases as \&X not *X
-*code2territory = *get_territory_from_code; -*territory2code = *get_code_from_territory; +*code2territory = \&get_territory_from_code; +*territory2code = \&get_code_from_territory; -*code2language = *get_language_from_code; -*language2code = *get_code_from_language; +*code2language = \&get_language_from_code; +*language2code = \&get_code_from_language;
Subject: TODO 0.18: aliases as \&X not *X && get_cldr_version()
Actually this is better: diff --git a/Locales.pm b/Locales.pm index 0ef9c54..4954269 100644 --- a/Locales.pm --- a/Locales.pm +++ b/Locales.pm @@ -7,6 +7,10 @@ $Locales::cldr_version = '2.0'; # change in POD my %singleton_stash; +sub get_cldr_version { + return $Locales::cldr_version; +} + sub new { my ( $class, $tag ) = @_; $tag = normalize_tag($tag) || 'en'; @@ -67,7 +71,7 @@ sub get_native_language_from_code { my ( $self, $code, $always_return ) = @_; my $class = ref($self) ? ref($self) : $self; - if ( !exists $locale->{'native_data'} ) { + if ( !exists $self->{'native_data'} ) { local $SIG{'__DIE__'}; # cpanel specific: ensure a benign eval does not trigger cpsrvd's DIE handler (may be made moot by internal case 50857) eval "require $class\::DB::Native;" || return; no strict 'refs'; @@ -685,8 +689,8 @@ sub get_code_from_territory { return; } -*code2territory = \&get_territory_from_code; -*territory2code = \&get_code_from_territory; +&code2territory = \&get_territory_from_code; +&territory2code = \&get_code_from_territory; #### language #### @@ -736,8 +740,8 @@ sub get_code_from_language { return; } -*code2language = \&get_language_from_code; -*language2code = \&get_code_from_language; +&code2language = \&get_language_from_code; +&language2code = \&get_code_from_language; #### utility functions ####
Actually @@ -689,8 +689,11 @@ sub get_code_from_territory { return; } -&code2territory = \&get_territory_from_code; -&territory2code = \&get_code_from_territory; +{ + no warnings 'once'; + *code2territory = \&get_territory_from_code; + *territory2code = \&get_code_from_territory; +} #### language #### @@ -740,8 +743,11 @@ sub get_code_from_language { return; } -&code2language = \&get_language_from_code; -&language2code = \&get_code_from_language; +{ + no warnings 'once'; + *code2language = \&get_language_from_code; + *language2code = \&get_code_from_language; +}
Also, clarify this comment: + # this negatives value behavior makes sense but is not defined either way in the CLDR. + # We've asked for clarification via http://unicode.org/cldr/trac/ticket/4049 my $abs_n = abs($n); # negatives keep same category as positive