foreach (0..$#{$object_ref->{array_ref}}) { printf("%d %s\n", $_, $object_ref->{array_ref}[$_]); }