Hello there,
I have a hash of arrays so that I can get my values like this:
my $array_value = $hash{'key'}[0];
My question: How can I find out how many elements the array has? Usually I do this with scalar():
my $size_of_array = scalar(@array);
But this one doesn't work:
my $size_of_array = scalar(%hash{'key'});
Do I have to go through every element of the array in $hash{'key'} and count up while it is defined?
Thanks and greetings,
fagga
I have a hash of arrays so that I can get my values like this:
my $array_value = $hash{'key'}[0];
My question: How can I find out how many elements the array has? Usually I do this with scalar():
my $size_of_array = scalar(@array);
But this one doesn't work:
my $size_of_array = scalar(%hash{'key'});
Do I have to go through every element of the array in $hash{'key'} and count up while it is defined?
Thanks and greetings,
fagga