http://www.perlmonks.org?node_id=1027578


in reply to Issue with grep & getting the right hash values out & possibly some other stuff

I also found that the only key is 6 (just the number 6).

The problem is that you are using the size of the arrays (eg. @quintic in a scalar context) as your hash keys. If you quoted the hashes thus:

$haystack{ "@quintic" }{ "@derivative" } = \@zeros;

Or used join something like this:

$haystack{ join ',', @quintic }{ join ',', @derivative } = \@zeros;

That might be nearer to what you are after, though it may not sure all the ills.

Note also that I've backslashed \@zeros to store a reference to the array, otherwise you are again storing the size of the array, not its contents.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.