in reply to Re: threads::shared hash
in thread threads::shared hash
You're right, I did some mistakes, I just modified my post :P
A shared hash works fine, but
the creation of a shared hash of hashes is the problem:
use threads;
use threads::shared;
use strict;
my %hash : shared;
my $var = "hello";
$hash{'foo'}{'bleh'} = "test";
$hash{$var}{'foo'} = "test";
Both 'foo' or $var keys returns the error: Invalid value for shared scalar.
A shared hash works fine, but
the creation of a shared hash of hashes is the problem:
use threads;
use threads::shared;
use strict;
my %hash : shared;
my $var = "hello";
$hash{'foo'}{'bleh'} = "test";
$hash{$var}{'foo'} = "test";
Both 'foo' or $var keys returns the error: Invalid value for shared scalar.
In Section
Seekers of Perl Wisdom