X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperllocale.pod;h=918abfc0d51d369d57387854eb8c173e0084659e;hb=18fd877aa5c85a3f8bdc7cb30b117cf8f0fe97a6;hp=a0962fcd7464dfd2572bb1753d60311bc6b79922;hpb=f979aebcf2bd35d620f0ca3623215cc1355f26d9;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perllocale.pod b/pod/perllocale.pod index a0962fc..918abfc 100644 --- a/pod/perllocale.pod +++ b/pod/perllocale.pod @@ -574,23 +574,23 @@ should use C<\w> inside a C block. See L<"SECURITY">. =head2 Category LC_NUMERIC: Numeric Formatting -In the scope of S>, Perl obeys the C locale -information, which controls an application's idea of how numbers should -be formatted for human readability by the printf(), sprintf(), and -write() functions. String-to-numeric conversion by the POSIX::strtod() +After a proper POSIX::setlocale() call, Perl obeys the C +locale information, which controls an application's idea of how numbers +should be formatted for human readability by the printf(), sprintf(), and +write() functions. String-to-numeric conversion by the POSIX::strtod() function is also affected. In most implementations the only effect is to change the character used for the decimal point--perhaps from '.' to ','. These functions aren't aware of such niceties as thousands separation and -so on. (See L if you care about these things.) +so on. (See L if you care about these things.) Output produced by print() is also affected by the current locale: it -depends on whether C or C is in effect, and corresponds to what you'd get from printf() in the "C" locale. The same is true for Perl's internal conversions between numeric and string formats: - use POSIX qw(strtod); - use locale; + use POSIX qw(strtod setlocale LC_NUMERIC); + + setlocale LC_NUMERIC, ""; $n = 5/2; # Assign numeric 2.5 to $n @@ -922,7 +922,7 @@ and also how strings are parsed by POSIX::strtod() as numbers: use locale; use POSIX qw(locale_h strtod); - setlocale(LC_NUMERIC, "de_DE") or die "Entshuldigung"; + setlocale(LC_NUMERIC, "de_DE") or die "Entschuldigung"; my $x = strtod("2,34") + 5; print $x, "\n"; # Probably shows 7,34. @@ -977,8 +977,11 @@ structure. =head2 Freely available locale definitions -There is a large collection of locale definitions at -ftp://dkuug.dk/i18n/WG15-collection . You should be aware that it is +There is a large collection of locale definitions at: + + http://std.dkuug.dk/i18n/WG15-collection/locales/ + +You should be aware that it is unsupported, and is not claimed to be fit for any purpose. If your system allows installation of arbitrary locales, you may find the definitions useful as they are, or as a basis for the development of