in reply to How to find length of $hash_ref

I assume by "a length of the hash elements" you mean the number of elements in the hash referenced. This is a faq. Since you are dealing with a reference, the code would be:

 my $num_keys = keys %$prop_ref;

If you instead want to determine string lengths of keys or values, you can use length.

Replies are listed 'Best First'.
Re^2: How to find length of $hash_ref
by priyankgandhi (Novice) on May 05, 2009 at 00:11 UTC
    Yes I meant number of elements only. Thanks
      Pretty simple when you dereference it eh? I'm told (and hopefully not being lied to!) that pretty much the only way to get at anything about the referenced value (besides, say, the position in the memory. Soooooo useful!) is to dereference.