develooper Front page | perl.perl5.porters | Postings from September 2014

Re: Hash::Util and read-only values

Thread Previous | Thread Next
Father Chrysostomos
September 20, 2014 16:59
Re: Hash::Util and read-only values
Message ID:
Reini Urban wrote:
> I don't like this. SvREADONLY should be the interface to
> readonly-ness, and not a combination thereof.
> To lock hash keys and hash values you simply unify the Hash::Util lock
> keys and values API, and store the locked bit in the HE.

That cannot possibly protect the values.

for my $ro ($locked_hash{locked_elem}) {
  # $ro now points to just the SV, so a HE flag would not prevent:
  $ro = 42;

> There's enough room there, but there's no room in the SV,

There is plenty of room in the SV.

> and changing
> the meaning of SvREADONLY again (with FAKE finally gone now)
> is problematic.

SvREADONLY still means read-only.

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