On Mon, Nov 17, 2003 at 05:13:14PM +0000, Alan Burlison wrote: > I think it had an effect if you applied it to the hash elements, but I > don't think it ever did anything to the hash itself. From looking through > the Hash::Utils documentation, I think I probably *do* want to use > restricted hashes, as I'm representing a tree of read-only C structs as a > tree of hashes, which is why I was fiddling around with SvREADONLY_on in > the first place. However, I'm not aware of any documentation on how this > should be done from XSUB code. I can always look at how Hash::Utils does > it, but that's implemented (mainly) in perl rather than XSUB - I was hoping > for some existing XSUB code I could plagarise ;-) IIRC (confirmed by looking at hv.c) SvREADONLY on the hv makes the hash a restricted hash (can't add new keys, can't access keys not present, can delete keys) SvREADONLY on a key also prevents it from being deleted. (as well as the regular effects of readonlyness) I think that the implementation should have been marked "subject to change" as it's not that clean. Nicholas ClarkThread Previous | Thread Next