Skip Menu |
 

This queue is for tickets about the Locales CPAN distribution.

Report information
The Basics
Id: 50679
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: 0.07

Attachments
rt50679-part2.patch
rt50679-part3.patch



Subject: use base fixup
Download (untitled) / with headers
text/plain 235b
in some environments we need to use MOD; before we can use base qw(MOD); Locales/Language.pm: use Locales::Base (); use Locales::Language::Base (); Locales/Country.pm: use Locales::Base (); use Locales::Country::Base ();
Download (untitled) / with headers
text/plain 180b
w/ above change setData needs fixed (ultimately needs reworked) for now or you get weird errors about trying to modify a readonly value in $@ when eval is attempted. very odd ...
Download (untitled) / with headers
text/plain 140b
another set of AUTOLOAD fix ups that are also necessary under certain circumstances (this module needs a rewrite, it's way too complex ;p)
Download rt50679-part3.patch
text/x-diff 1.9k
Index: Locales/Base.pm =================================================================== --- Locales/Base.pm (revision 40497) +++ Locales/Base.pm (revision 40498) @@ -118,7 +118,7 @@ unless ( eval "require $module;" ) { my $defaultLocale = _getDefaultLocale; if ( $locale eq $defaultLocale ) { - warn ( "$defaultLocale is unsupported, trying $FALLBACK_LOCALE" ); + warn ( "$defaultLocale is unsupported, trying $FALLBACK_LOCALE" ) unless $defaultLocale eq $FALLBACK_LOCALE; $object = _loadFallBackLocale($caller); } else { Index: Locales/Country.pm =================================================================== --- Locales/Country.pm (revision 40497) +++ Locales/Country.pm (revision 40498) @@ -65,7 +65,18 @@ my ($method) = ( $AUTOLOAD =~ /::([^:]+)$/ ); return unless ( $method ); - $self->$method ( $arg ); + if ($self->can($method)) { + return $self->$method ( $arg ); + } + elsif (Locales::Country::Base->can($method)) { + return Locales::Country::Base->$method( $arg ); + } + elsif(Locales::Base->can($method)) { + return Locales::Base->$method( $arg ); + } + else { + $self->$method ( $arg ); # we already know this will fail but we want perl to give the message + } } Index: Locales/Language.pm =================================================================== --- Locales/Language.pm (revision 40497) +++ Locales/Language.pm (revision 40498) @@ -60,7 +60,18 @@ my ($method) = ( $AUTOLOAD =~ /::([^:]+)$/ ); return unless ( $method ); - $self->$method ( $arg ); + if ($self->can($method)) { + return $self->$method ( $arg ); + } + elsif (Locales::Language::Base->can($method)) { + return Locales::Language::Base->$method( $arg ); + } + elsif(Locales::Base->can($method)) { + return Locales::Base->$method( $arg ); + } + else { + $self->$method ( $arg ); # we already know this will fail but we want perl to give the message + } }


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.