Hi there,
Does anyone know how to count the number of keys in a hash?
You can use this to get the number of elements in an array
$count=$#{$array};
but I've got a grouping hash and for the life of me can't figure out how to find out how many keys there are without scanning it twice. once to count and the second time to do what I need to do based on the count, and none of my books mention it. I need a better book.
Thanks for replying to such an inane question.
peace.
Kyle
Does anyone know how to count the number of keys in a hash?
You can use this to get the number of elements in an array
$count=$#{$array};
but I've got a grouping hash and for the life of me can't figure out how to find out how many keys there are without scanning it twice. once to count and the second time to do what I need to do based on the count, and none of my books mention it. I need a better book.
Thanks for replying to such an inane question.
peace.
Kyle