sub getSecondArraySize { # receives the argument my ($index, %array_to_count) = @_; # return the count return $#{$array_to_count{$index}}+1; }