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



Subject: use base fixup
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 ();
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 ...
another set of AUTOLOAD fix ups that are also necessary under certain circumstances (this module needs a rewrite, it's way too complex ;p)
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 + } }