develooper Front page | perl.perl5.porters | Postings from April 2006

Re: Make encoding lexical ?

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
April 1, 2006 02:05
Subject:
Re: Make encoding lexical ?
Message ID:
20060401100512.GG32132@plum.flirble.org
On Sat, Apr 01, 2006 at 01:28:25AM +0200, Rafael Garcia-Suarez wrote:
> I haven't tried, but it should be possible now to make the encoding
> and encoding::warnings modules lexical by replacing PL_encoding (aka
> ${^ENCODING}) by an element in %^H (at compilation) and by a lookup in
> cop_hints (at run time) (if I'm following the new implementation
> correcly.) This would introduce an incompatibility with 5.8, and this
> would fork code of those modules, but this would also remove the large
> caveats listed in their documentation.

Well, if I'm following the new implementation correctly it would work.
Although I'd be tempted to add a regular hints bit (or at least a flag bit
on the relevant ops) to say "there is something to find in cop_hints" as
the lookup is linear and quite a few ops use PL_encoding.

We could keep ${^ENCODING} and make it hook through to reads/writes on
%^H (and therefore the cop hints). I don't know if that reduces the module
implementation forking issues.

Nicholas Clark

Thread Previous | 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