I have a hash with two keys and the values are in an array. so,
%graph;
@{$graph{$root}{"children"} = ('apple', 'banana', 'orange');
I am trying to get the maximal size of the index which is 2, usually I would do
$#array
However, when I do
$#{$graph{$root}{"children"}
it gets commented out.
The code below works for me, giving the output:
Code — note the properly closed sets of braces (the code in the question has issues that prevent it compiling):
(Perl 5.12.1 on RHEL 5 for x86/64)