for (my $item = 0; $item <= $#{$ref}; $item++) { print $item; print $ref->[$item]->{'key1'}; }#for