Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

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
Domain Nodelet?
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 studying the Monastery: (2)
As of 2021-10-23 17:37 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (88 votes). Check out past polls.