in reply to Testing for hash key value

That's because the code %{$hash{'one'}} actually says to perl "take the hash key value stored in $hash{'one'} and pretend it is a hash reference". Since it isn't a hash reference, perl throws an error. Just remove the %{} from that if statement and your code will work the way you want it to.

Update: djantzen kindly pointed out what I overlooked - that you also have to remove the 'keys' command or perl will still throw an error. However this leads to a rather nice way to check for what you want:

if ((eval"%{$hash{'one'}}")) { print "It's a hash\n"; } else { print "It's not a hash\n"; }

So it turns out there's more than one way to do it :)

____________________
Jeremy
I didn't believe in evil until I dated it.