@@ -14,6 +14,19 @@ BEGIN {
1414 use_ok(' version' , 0.9929);
1515}
1616
17+ sub radix { # Returns the radix character for the current locale.
18+
19+ # Use localeconv() on earlier perls; if it is just a stub, assume a dot.
20+ if (! $^V or $^V lt v5.37.4) {
21+ return localeconv()-> {decimal_point } || " ." ;
22+ }
23+
24+ # localeconv() may be a stub on some platforms. But on later perls,
25+ # langinfo() will always exist and returns the best available value.
26+ use if $^V && $^V ge v5.37.4, ' I18N::Langinfo' => qw( langinfo RADIXCHAR) ;
27+ return langinfo(RADIXCHAR);
28+ }
29+
1730SKIP: {
1831 skip ' No locale testing for Perl < 5.6.0' , 7 if $] < 5.006;
1932 skip ' No locale testing without d_setlocale' , 7
@@ -38,10 +51,10 @@ SKIP: {
3851 while (<DATA >) {
3952 chomp ;
4053 $loc = setlocale( LC_ALL, $_ );
41- last if $loc && localeconv() -> { decimal_point } eq ' ,' ;
54+ last if $loc && radix() eq ' ,' ;
4255 }
4356 skip ' Cannot test locale handling without a comma locale' , 6
44- unless $loc and localeconv() -> { decimal_point } eq ' ,' ;
57+ unless $loc and radix() eq ' ,' ;
4558
4659 setlocale(LC_NUMERIC, $loc );
4760 $ver = 1.23; # has to be floating point number
0 commit comments