The error message is exactly right. The first element of the array reference you've assigned to person is the value 0, which is not a hash reference. It's a plain scalar value. In Perl, you don't assign pairs of indices and values to arrays. Perl will automatically use the correct index numbers when you assign a list to an array.
Do what the first commenter suggested and your code will work better.
In reply to Re^3: Mistake in data structure use?
by chromatic
in thread Mistake in data structure use?
by McLogic
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |