in reply to Why is AofH the way it is?

Because $_ is the hash reference, not the index to the array, and $Array[$_] stringifies the hash reference (to something like "HASH(0x200243d4)", which perl interprets as a "very big" number, and then tries to auto allocate that many elements for your array, and runs out of memory.

Replies are listed 'Best First'.
Re: Re: Why is AofH the way it is?
by Elian (Parson) on Feb 12, 2003 at 22:18 UTC
    Almost. Perl doesn't stringify the reference--a reference in numeric context is the address, taken as an integer. (Which is why you can compare two references with ==) End result is you have an enourmous array index, which is bad.