Programming Languages C# Subjective
Mar 14, 2013

What does length(%HASH) produce if you have thirty-seven random keys in a newly created hash?

Detailed Explanation

5
length() is a built-in prototyped as sub length($), and a scalar prototype silently changes aggregates into radically different forms. The scalar sense of a hash is false (0) if it's empty, otherwise it's a string representing the fullness of the buckets, like "18/32" or "39/64". The length of that string is likely to be 5. Likewise, `length(@a)' would be 2 if there were 37 elements in @a.

Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback