summaryrefslogtreecommitdiff
path: root/lib/locale.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/locale.pm')
-rw-r--r--lib/locale.pm7
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