Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Issue with hash definition & possibly some other stuff

by BrowserUk (Pope)
on Apr 08, 2013 at 18:44 UTC ( #1027578=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1027578]
help
Chatterbox?
[Corion]: ... those in an automated fashion seems somewhat hard to me. Although it should do wonders for the test coverage ;)
[haukex]: Corion: I once wrote an automated thingy for that here
[haukex]: here's the code that uses it
[Corion]: haukex: Hmm - maybe I can reuse that. I see that it uses Pod::Parser, which I think was one of the more fragile parsers. But if I'm statically (re)generating the tests instead of doing that "live" on the client/tester machines, that's a much smaller...
[Corion]: ... problem space than trying to cater to all versions of Pod::Parser(s)
[haukex]: I think you're right, I think Pod::Simple is the preferred parser now
[haukex]: But I was just using it as an author test anyway

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2017-02-27 12:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (385 votes). Check out past polls.