in reply to Shared hash within shared hash of hash???
threads::shared keeps all shared variables in a separate interpreter. If you declared hash like:
then hash and all its values will be stored in this dedicated interpreter. In case of:my %hash : shared = ();
you creating anonymous hash in the current interpreter and saving reference to it in the shared interpreter which is not allowed, that's why you should create a shared copy:$hash{foo} = {};
Another possibility:$hash{foo} = shared_clone({});
my %tmp : shared = (); $hash{foo} = \%tmp;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Shared hash within shared hash of hash???
by ISAI student (Scribe) on Jan 02, 2013 at 12:31 UTC | |
by dave_the_m (Monsignor) on Jan 02, 2013 at 17:30 UTC | |
by BrowserUk (Patriarch) on Jan 02, 2013 at 15:53 UTC | |
by zwon (Abbot) on Jan 02, 2013 at 12:46 UTC | |
by ISAI student (Scribe) on Jan 02, 2013 at 14:53 UTC | |
by zwon (Abbot) on Jan 03, 2013 at 14:44 UTC |