fxmakers has asked for the wisdom of the Perl Monks concerning the following question:
Hi!
Here's my code:
Can't create a shared hash of hashes.
$hash{'foo'} = 1; #works fine.
perl -v: This is perl, v5.8.2 built for cygwin-thread-multi-64int
Any ideas?
Thanks!
-UPDATED POST-
Here's my code:
Script is not interpreted and returns: Invalid value for shared scalar at test.pl line 7.use threads; use threads::shared; my %hash : shared; my $var = "hello"; $hash{'foo'}{'bar'} = 1; $hash{$var}{'bar'} = 1;
Can't create a shared hash of hashes.
$hash{'foo'} = 1; #works fine.
perl -v: This is perl, v5.8.2 built for cygwin-thread-multi-64int
Any ideas?
Thanks!
-UPDATED POST-
Edited by Chady -- added code tags.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: threads::shared hash
by BrowserUk (Patriarch) on Mar 27, 2004 at 01:01 UTC | |
by fxmakers (Friar) on Mar 27, 2004 at 01:14 UTC | |
by BrowserUk (Patriarch) on Mar 27, 2004 at 01:30 UTC | |
by fxmakers (Friar) on Mar 27, 2004 at 02:28 UTC | |
Re: threads::shared hash
by tilly (Archbishop) on Mar 27, 2004 at 07:20 UTC | |
by liz (Monsignor) on Mar 27, 2004 at 11:19 UTC |
Back to
Seekers of Perl Wisdom