in reply to Re^2: share array of hashes between main program and thread
in thread share array of hashes between main program and thread
how could i add an additional single hash to a line i ($i) of my array of hashes
Do you mean: how can I add an extra key-value pair to one of the hashes in my AoH?
Assuming you do, like this:
$Array[ $i ]{ newKey } = 'newValue'.
Once the reference is shared (or is a reference to a shared hash--same thing), adding pairs is just the same as normal. Because scalars, (keys and values) are shared by value. Only references are shared by reference.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: share array of hashes between main program and thread
by Adler (Novice) on Nov 11, 2009 at 11:54 UTC | |
by BrowserUk (Patriarch) on Nov 11, 2009 at 12:01 UTC |