in reply to undef(%hash) not doing what I expect for HoH

I'm confused. %hash is your hash of hashes. This implies that %hash is a hash, not a reference to a hash.

So when you attempt to recover keys %{$hash->{$key1}} you're attempting to treat %hash as a reference. Don't you mean to try keys %{$hash{$key1}}?

Update: actually I tried a little script of my own and when I added keys %{$hash->{$key1}} I got a compiler error saying that I hadn't defined $hash. Try adding use strict to your script and see if the compiler helps you solve the problem..

Replies are listed 'Best First'.
Re^2: undef(%hash) not doing what I expect for HoH
by doowah2004 (Monk) on Oct 12, 2006 at 15:15 UTC
    Wow, I am rusty. You are exactly right! And of course an undef on a reference does not affect the hash and an undef on a hash that I was not even using affects it even less... Thank you!