develooper Front page | perl.perl5.porters | Postings from May 2012

Re: [perl #112126] Hash::Util export bug

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
May 8, 2012 04:27
Subject:
Re: [perl #112126] Hash::Util export bug
Message ID:
20120508112706.GH9069@plum.flirble.org
On Sat, Apr 28, 2012 at 09:54:31PM -0500, Jesse Luehrs wrote:

> Which makes me wonder why SvREADONLY is exposed to perl-space at all.
> It's not like it even keeps Hash::Util from needing XS. Wouldn't it make
> things a lot easier to follow if Internals::SvREADONLY was removed in
> favor of just adding a few bits to ext/Hash-Util/Util.xs?

I think Hash::Util would be easier to read if it better encapsulated the
unfortunate fact that it overloads the use of SVf_READONLY to mean a locked
hash, by putting the relevant necessary C-level manipulation into one well-
named place in its XS code.

Yes, constant.pm is (currently) using Internals::SvREADONLY(), but for the
"conventional" purpose (a read only scalar value). That's unfortunate. I
wonder how to fix that. I'm even wondering if it's actually necessary for
constant.pm to do that, or if it's just a "nice to have". (In that, nothing
relies on enforcement of not being able to manipulate references in the
symbol table. It's not like it can't be worked round)

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