develooper Front page | perl.perl5.porters | Postings from March 2011

Re: use locale

Thread Previous
March 12, 2011 03:59
Re: use locale
Message ID:
On 12 March 2011 12:44, Tom Christiansen <> wrote:
> demerphq wrote on Sat, 12 Mar 2011 12:37:39 +0100:
> Good morning.  Well, or afternoon to you.

Good Morning. :-)

>>> On a related note, aren't use locale and /pat/l
>>> also pretty foul dead-ends?
>>> You're completely at the mercy of your vendor's locales,
>>> which aren't all they're cracked up to be.
>> I consider "use locale" broken and preserved only for backwards
>> compatibility. IMO we should get rid of it, deprecate it, whatever.
>> Certainly document it as "DO NOT USE THIS". :-)
> That's what my current thought is, and I'm glad to see I'm not
> alone in this.  I don't think see how one can reliably "fix" this.
> I think we've all always known locales are broken, but the sooner
> the documentation is updated to resist luring people into something
> that doesn't work, the better.
>> Thanks for giving me the opportunity to say this twice. :-)
> After the day progresses a bit and we hear more people chip in
> (Karl wakes up later than I do), I'll try to put together some
> language to float by everyone.
> I'm not talking about any code changes, just documentation.

From the point of view of the regex engine long term full on
deprecation would be much appreciated I think.

There is a lot of crud involved in the use locale stuff, as it forces
lots of things to run time (unless karl changed this recently), so
deprecating it and removing it would enable a lot of essentially
useless code to be chainsawed away.

I think people using locale should stick to an old perl where the
behaviour of the perl and use locale together are well defined.

The simple fact is there is no really good way for us to test use
locale behaviour, and I think most of the people working on perl do
not care about it and do the absolute minimum to keep its tests from
failing. Given the difficulties testing simpler *standard* behavior
one can assume that complex code like use locale is suffering from
considerable bit rot each release. (For instance the TRIE code had a
serious bug in it for ages before anyone noticed, despite aggressive
testing by me and many others, and that was in "normal" code.)

So use local is probably already deprecated by instability and anyone
sane has "upgraded" newer stabler features, or hasn't upgraded at all.


perl -Mre=debug -e "/just|another|perl|hacker/"

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