develooper Front page | perl.perl5.porters | Postings from July 2001

Re: [PATCH for discussion] new feature: clamp %hash

Thread Previous | Thread Next
Nick Ing-Simmons
July 23, 2001 01:30
Re: [PATCH for discussion] new feature: clamp %hash
Message ID:
Jeffrey Friedl <> writes:
>|> Well, there are tradeoffs to his proposal, and they should at least be
>|> mentioned.....
>Sorry for the self-followup, but one overridingly important issue I forgot
>to mention is that the semantics of marking an HV "readonly" can be quite
>different than the marking of its individual values.
>    my $ref = \$hash{SOMEKEY};
>    somehow_mark_readonly %hash;
>it is clear that
>	$hash{SOMEKEY} = 3;
>should not be allowed, but what about
>	$$ref = 3;
>I can imagine convincing arguments for semantics that do and don't
>allow updates via the reference.

I can't. If the hash in readonly/clamped then it does not matter how 
you reach it it is readonly/clamped.

Nick Ing-Simmons

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