Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Array lookup

by SuicideJunkie (Vicar)
on Apr 16, 2018 at 20:56 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-04-18 03:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found