diff options
author | Niko Tyni <ntyni@debian.org> | 2010-10-19 21:55:14 +0300 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-10-27 05:50:18 -0700 |
commit | 903eb63f7d8d47a38971a8e9af7201b9927882cf (patch) | |
tree | 369b98666559416d15f502c9c080d6941cc4c898 /pod/perlform.pod | |
parent | 9c6df44eda98e5e43bb8a8d4d71688ae77f9a590 (diff) | |
download | perl-903eb63f7d8d47a38971a8e9af7201b9927882cf.tar.gz |
LC_NUMERIC documentation updates + tests
Most of the confusion around LC_NUMERIC was fixed with commits
7e4353e96785be675a69a6886d154405dbfdc124 and
2095dafae09cfface71d4202b3188926ea0ccc1c
but two errors remain:
- the early parts of perllocale.pod still say printf() uses LC_NUMERIC
with just 'use locale' when actually a POSIX::setlocale() call is
also needed
- format() hasn't used LC_NUMERIC unconditionally since 5.005_03
(commit 097ee67dff1c60f201bc09435bc6eaeeafcd8123).
Update the documentation and test the claims in t/run/locale.t.
Diffstat (limited to 'pod/perlform.pod')
-rw-r--r-- | pod/perlform.pod | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/pod/perlform.pod b/pod/perlform.pod index 3cfa1b768d..df0f0a174d 100644 --- a/pod/perlform.pod +++ b/pod/perlform.pod @@ -166,9 +166,9 @@ token on the first line. If an expression evaluates to a number with a decimal part, and if the corresponding picture specifies that the decimal part should appear in the output (that is, any picture except multiple "#" characters B<without> an embedded "."), the character used for the decimal -point is B<always> determined by the current LC_NUMERIC locale. This -means that, if, for example, the run-time environment happens to specify a -German locale, "," will be used instead of the default ".". See +point is determined by the current LC_NUMERIC locale if C<use locale> is in +effect. This means that, if, for example, the run-time environment happens +to specify a German locale, "," will be used instead of the default ".". See L<perllocale> and L<"WARNINGS"> for more information. @@ -442,15 +442,11 @@ Lexical variables (declared with "my") are not visible within a format unless the format is declared within the scope of the lexical variable. (They weren't visible at all before version 5.001.) -Formats are the only part of Perl that unconditionally use information -from a program's locale; if a program's environment specifies an -LC_NUMERIC locale, it is always used to specify the decimal point -character in formatted output. Perl ignores all other aspects of locale -handling unless the C<use locale> pragma is in effect. Formatted output -cannot be controlled by C<use locale> because the pragma is tied to the -block structure of the program, and, for historical reasons, formats -exist outside that block structure. See L<perllocale> for further -discussion of locale handling. +If a program's environment specifies an LC_NUMERIC locale and C<use +locale> is in effect when the format is declared, the locale is used +to specify the decimal point character in formatted output. Formatted +output cannot be controlled by C<use locale> at the time when write() +is called. See L<perllocale> for further discussion of locale handling. Within strings that are to be displayed in a fixed length text field, each control character is substituted by a space. (But remember the |