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
From:
Karl Williamson
Date:
July 15, 2013 16:21
Subject:
Re: [perl #118795] locale changes in 5.19.1 break LC_NUMERIC handling
Message ID:
51E42165.2030500@khwilliamson.com
On 07/09/2013 07:52 PM, John Peacock wrote:
> 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.

Here is a patch to the patch.
>
> 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 changed the new text of the patch to just have a 'use locale'.'  I 
don't understand what the other comments of yours are referring to. 
I've looked at the blead perllocale, and I believe it has a 'use locale' 
everywhere it should have.
>
> 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.

I strongly believe that there should be one pod that deals with all the 
intricacies of using locales.  That pod then would be perllocale. 
POSIX.pod then should have a quick reference for setlocale, referring to 
the other one for more in-depth coverage.  I changed the text slightly 
to emphasize that.


Thread Previous


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