Subject: | Unicode::Collate::Locale should search for locales in @INC |
Locales could be located in a completely different path than the
Locale.pm module. The attached patch should fix the behavior by
searching all the @INC paths.
Subject: | perl-5.14.2-locale-search-inc.patch |
diff --git a/cpan/Unicode-Collate/Collate/Locale.pm b/cpan/Unicode-Collate/Collate/Locale.pm
index b26db00..35f4fb3 100644
--- a/cpan/Unicode-Collate/Collate/Locale.pm
+++ b/cpan/Unicode-Collate/Collate/Locale.pm
@@ -8,7 +8,6 @@ our $VERSION = '0.73';
use File::Spec;
-(my $ModPath = $INC{'Unicode/Collate/Locale.pm'}) =~ s/\.pm$//;
my $PL_EXT = '.pl';
my %LocaleFile = map { ($_, $_) } qw(
@@ -56,7 +55,12 @@ sub _fetchpl {
my $f = $LocaleFile{$accepted};
return if !$f;
$f .= $PL_EXT;
- my $path = File::Spec->catfile($ModPath, $f);
+ my $path;
+ for my $incpath (@INC) {
+ $path = File::Spec->catfile($incpath, 'Unicode', 'Collate', 'Locale', $f);
+ last if -f $path;
+ $path = undef;
+ }
my $h = do $path;
croak "Unicode/Collate/Locale/$f can't be found" if !$h;
return $h;