Don't ask to ask, just ask | |
PerlMonks |
Re: Wrong result for "length keys %$hashref"?by philipbailey (Curate) |
on Mar 14, 2011 at 19:48 UTC ( [id://893132]=note: print w/replies, xml ) | Need Help?? |
The documentation of length answers your question: 'length Returns the length in characters of the value of EXPR. If EXPR is omitted, returns length of $_. Note that this cannot be used on an entire array or hash to find out how many elements these have. For that, use "scalar @array" and "scalar keys %hash" respectively.'
In Section
Seekers of Perl Wisdom
|
|