develooper Front page | perl.perl5.porters | Postings from July 2013

Re: [perl #118795] locale changes in 5.19.1 break LC_NUMERIC handling

Thread Previous | Thread Next
John Peacock
July 10, 2013 01:52
Re: [perl #118795] locale changes in 5.19.1 break LC_NUMERIC handling
Message ID:
On 07/09/2013 09:01 PM, karl williamson via RT wrote:
> If there is something you would like changed, let me know, or better,
> submit a patch, which I would promptly consider.

The patch looks good, though I would have explicitly put 'use locale' in
the example code and explained when or why you _wouldn't_ need it, 
instead of the other way around.  For that matter, I think that the 
examples in perllocale should also have 'use locale' explicitly listed 
for precisely the same reasons.  Yes, the previous paragraph explains 
that Perl will ignore locales without it, but if you are using 
setlocale() for non-trivial purposes, you need to have 'use locale' in 
force.  Perhaps adding a lexical scope after the initial setlocale() to 
emphasize that only within that block will Perl respect the locale.

I wonder whether the much better documentation from perllocale on using 
setlocale() should be in the POSIX POD instead and the references 
reversed.  It is almost always better to maintain locality (no pun 
intended) between the documentation and the function's actual namespace, 
rather than pointing at some other document for the important details.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About