develooper Front page | perl.perl5.porters | Postings from November 2000

perllocale.pod changes

Thread Next
From:
Konovalov, Vadim
Date:
November 12, 2000 23:09
Subject:
perllocale.pod changes
Message ID:
402099F49BEED211999700805FC7359F825416@ru0028exch01.spb.lucent.com
Here are some changes for pellocale.pod proposed. The most
significant change is at the end, because currently perl
behaves in a different way than described. Namely on my Win32

  perl -e "use locale; use POSIX; print setlocale
LC_ALL,'Russian_Russia.866';print 1.23"

prints

Russian_Russia.866
1,23

Probably that explanation need to be reorganized, but I will not even
try to do that - documentation's locale is different for me :)
(currently my brain's 'print' function works correctly only for Russian
locales :)


--- perllocale.pod.orig	Tue Nov 07 03:05:54 2000
+++ perllocale.pod	Sun Nov 12 01:53:54 2000
@@ -445,7 +445,7 @@
 if you "use locale".
 
 	A B C D E a b c d e
-	A a B b C c D d D e
+	A a B b C c D d E e
 	a A b B c C d D e E
 	a b c d e A B C D E
 
@@ -453,13 +453,13 @@
 characters are in the current locale, in that locale's order:
 
         use locale;
-        print +(sort grep /\w/, map { chr() } 0..255), "\n";
+        print +(sort grep /\w/, map { chr } 0..255), "\n";
 
 Compare this with the characters that you see and their order if you
 state explicitly that the locale should be ignored:
 
         no locale;
-        print +(sort grep /\w/, map { chr() } 0..255), "\n";
+        print +(sort grep /\w/, map { chr } 0..255), "\n";
 
 This machine-native collation (which is what you get unless S<C<use
 locale>> has appeared earlier in the same block) must be used for
@@ -554,9 +554,9 @@
 These functions aren't aware of such niceties as thousands separation and
 so on.  (See L<The localeconv function> if you care about these things.)
 
-Output produced by print() is B<never> affected by the
-current locale: it is independent of whether C<use locale> or C<no
-locale> is in effect, and corresponds to what you'd get from printf()
+Output produced by print() is also affected by the
+current locale: it depends on whether C<use locale> or C<no locale> 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:
 
@@ -565,9 +565,9 @@
 
         $n = 5/2;   # Assign numeric 2.5 to $n
 
-        $a = " $n"; # Locale-independent conversion to string
+        $a = " $n"; # Locale-dependent conversion to string
 
-        print "half five is $n\n";       # Locale-independent output
+        print "half five is $n\n";       # Locale-dependent output
 
         printf "half five is %g\n", $n;  # Locale-dependent output
 


<!ENTITY Vadim REALLIFE "Vadim V.Konovalov, St.Petersburg, Russia">
&Vadim;

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About