$numInHash = %$EDHRef;

This isn't doing what you think it is. Evaluating a hash in scalar context is rarely useful. They don't work the same way as arrays.

What you really want is to call keys in scalar context. That will give you the number of keys in the hash.

$numInHash = keys %$EDHRef;

See the Copyright notice on my home node.

Perl training courses

In reply to Re: hashes of array references by davorg
in thread hashes of array references by tobyperl

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":