So, I have a hash %HoHoA. Each top level hash key has a second level hash key as a value. Each second level hash has arrays-of-arrays as values.
In perl's debugger it looks something like this:
0 'Top_key_1'
1 HASH(0x...)
'Second_Key_1' => ARRAY(0x...)
0 'string 1'
1 'string 2'
'Second_Key_2' => ARRAY(0x...)
0 ARRAY(0x...)
0 'string 3'
1 'string 4'
2 'string 5'
1 ARRAY(0x...)
0 'string 6'
1 'string 7'
2 'Top_key_2'
I'm trying to get the size of each suite's two arrays. In the above example, Second_Key_2 has two arrays, the 0th one is size 3.
my $count1 = $#{$HoHoA{$top_key}{$second_key}[0]}+1;
my $count2 = $#{$HoHoA{$top_key}{$second_key}[1]}+1;
and
my $count1 = @{$HoHoA{$group}{$suite}[0]};
my $count2 = @{$HoHoA{$group}{$suite}[1]};
I get an error message like: Can't use string ("string 3") as an ARRAY ref while "strict refs" in use
Why am I getting that error message, and what should I do instead?