diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2014-06-10 20:18:50 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2014-06-10 20:25:48 -0400 |
commit | 395e49858e6cabdc5c8ecc0647e256452bd20f64 (patch) | |
tree | c590d337eba99128faed38e8f68d2e8517fb5ab3 /lib/locale.pm | |
parent | 097675bf0fb77cbfa1453e5928bafec9b7f0c482 (diff) | |
download | perl-395e49858e6cabdc5c8ecc0647e256452bd20f64.tar.gz |
Locale tests assumed POSIX, not true in minitest.
Diffstat (limited to 'lib/locale.pm')
-rw-r--r-- | lib/locale.pm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/locale.pm b/lib/locale.pm index 52279a1693..886fb3b491 100644 --- a/lib/locale.pm +++ b/lib/locale.pm @@ -96,9 +96,14 @@ sub import { $arg =~ s/^://; + eval { require POSIX; import POSIX 'locale_h'; }; + unless (defined &POSIX::LC_CTYPE) { + return; + } + # Map our names to the ones defined by POSIX $arg = "LC_" . uc($arg); - use POSIX 'locale_h'; + my $bit = eval "&POSIX::$arg"; if (defined $bit) { # 1 is added so that the pseudo-category :characters, which is |