Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: Array lookup

by SuicideJunkie (Vicar)
on Apr 16, 2018 at 20:56 UTC ( #1213024=note: print w/replies, xml ) Need Help??

in reply to Array lookup

Well, as you saw in the dumper, your hash contains ARRAY(0x1a56440) and only ARRAY(0x1a56440). That's the stringification of the address of your array. (Which also points to where the problem is happening.)

You then push all the elements of your list unless the element is 'ARRAY(0x1a56440)'. Which is all the elements.

When you push all the elements on, of course your arrays will have the same contents. :)

Check how you're passing those arrays in, and make sure you dereference the arrayrefs getting passed in, to avoid assigning a single value (the arrayref) into a new array of one element.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1213024]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (1)
As of 2020-10-25 05:30 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (249 votes). Check out past polls.