Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^10: Adding hashes to already existing array

by ExReg (Priest)
on May 07, 2016 at 00:07 UTC ( [id://1162418]=note: print w/replies, xml ) Need Help??


in reply to Re^9: Adding hashes to already existing array
in thread Adding hashes to already existing array

The code I have is part of a larger system with lots of arrays and lots of data, and I'm afraid I have no way of getting it off and showing it. The code that I was using was the same as my first reply to you only with the variable names changed to protect the innocent. The results were also the same as in my reply with the data values also changed.

I was interested in preserving the contents of the array, so I was trying not to destroy the data in it. That is why I was trying such unholy constructs. Looking at the answers that I received, I think that I will go with the ideas suggested by haukex and poj where I change the string value in the array into some hashes. It will require a little refactoring of places that access @excerpts (not its real name). To get the string contents, it will have to access $excerpts[$i]{content} instead of $excerpts[$i]. But it will now be possible to access $excerpts[$i]{fpart} and $excerpts[$i]{bpart} as well.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-04-19 13:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found