Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Problem with doubles results

by NERDVANA (Curate)
on May 17, 2024 at 20:36 UTC ( [id://11159518]=note: print w/replies, xml ) Need Help??


in reply to Problem with doubles results

You declared my %hash outside of the loop, so each time you push @updated_data, \%hash you get a reference to the same hash. So, it will be an array of many references to the final value of the hash on the last loop iteration.

Declare my %hash inside the loop to get a new one each time.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (1)
As of 2024-07-19 02:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.