There seems to be only one global variable with name @array. Thus \@array always returns a reference to the same array, which is probably not what you want.
The solution is to use strict; and declare your variables in appropriate scopes.
In reply to Re^2: How to make a array of hashes and search them
by moritz
in thread How to make a array of hashes and search them
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |