in reply to Re: Truthfulness of references
in thread Truthfulness of references

Thanks ikegami.

So I should use:

if ( %$hash_ref )

to check whether the hash is empty or not?

By the way, thanks for your reply on this. I haven't used the Chatterbox before, so I wasn't sure how to respond ( I've been meaning to read up on it, but haven't found the time ).

njcodewarrior

Replies are listed 'Best First'.
Re^3: Truthfulness of references
by ikegami (Patriarch) on Mar 14, 2007 at 07:12 UTC

    Yes, when $hash_ref holds a reference to a hash.

    If $hash_ref doesn't hold a reference to a hash, you'll get a warning or a runtime error depending on what it holds and whether use strict 'refs'; is active or not.