diff options
author | Karl Williamson <khw@cpan.org> | 2015-11-19 19:57:11 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2015-11-20 10:53:26 -0700 |
commit | 467a667a478081da892b51bc98585434c22c3069 (patch) | |
tree | fb90e17b5afb00dbeaeff75e5d61b7fe9eda2c89 /lib | |
parent | cfe9fa91224d5b7906a7d71122116055fe118bca (diff) | |
download | perl-467a667a478081da892b51bc98585434c22c3069.tar.gz |
lib/locale.pm: Fix so works on platforms without LC_CTYPE
These may not actually exist in the wild, but it is better to be
general.
This also adds an XXX comment about future possibilities.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/locale.pm | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/locale.pm b/lib/locale.pm index fb91f0a7fa..e2317ca871 100644 --- a/lib/locale.pm +++ b/lib/locale.pm @@ -1,6 +1,6 @@ package locale; -our $VERSION = '1.07'; +our $VERSION = '1.08'; use Config; $Carp::Internal{ (__PACKAGE__) } = 1; @@ -97,15 +97,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 my $LC = "LC_" . uc($arg); my $bit = eval "&POSIX::$LC"; - if (defined $bit) { + if (defined $bit) { # XXX Should we warn that this category isn't + # supported on this platform, or make it + # always be the C locale? # Verify our assumption. if (! ($bit >= 0 && $bit < 31)) { |