develooper Front page | perl.perl5.porters | Postings from October 2002

Re: Hash::Util::lock_keys inhibits bless

Thread Previous | Thread Next
From:
andreas.koenig
Date:
October 3, 2002 21:39
Subject:
Re: Hash::Util::lock_keys inhibits bless
Message ID:
m3bs6astr2.fsf@k242.linux.bogus
>>>>> On Wed, 02 Oct 2002 16:18:28 +0100, hv@crypt.org (hv) said:

  > andreas.koenig@anima.de (Andreas J. Koenig) wrote:
  > :Turning Tim's words into a patch...

  > Thanks, applied as #17961.

Yves Orton has kindly provided a rephrased version to correct for my
"tricky" English.

--- perl-5.8.0@17974/lib/Hash/Util.pm~	Fri Oct  4 06:17:44 2002
+++ perl-5.8.0@17974/lib/Hash/Util.pm	Fri Oct  4 06:36:37 2002
@@ -59,10 +59,11 @@
 
 Restricts the given %hash's set of keys to @keys.  If @keys is not
 given it restricts it to its current keyset.  No more keys can be
-added.  delete() and exists() will still work, but it does not effect
-the set of allowed keys. B<Note>: the current implementation does not
-allow you to bless() the resulting hash, so if you want to use
-lock_keys() for an object, you need to bless it prior to locking it.
+added. delete() and exists() will still work, but will not alter
+the set of allowed keys. B<Note>: the current implementation prevents
+the hash from being bless()ed while it is in a locked state. Any attempt
+to do so will raise an exception. Of course you can still bless()
+the hash before you call lock_keys() so this shouldn't be a problem.
 
   unlock_keys(%hash);
 


-- 
andreas

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