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

Re: Make encoding lexical ?

Thread Previous | Thread Next
Nicholas Clark
April 1, 2006 02:05
Re: Make encoding lexical ?
Message ID:
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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About