Seem to be getting a problem when trying to share hashes, I think I am
doing it write, or maybe this is a known problem?  This is the kind of
thing I am trying to do in a module called Thread/Manage.pm

use threads;
use threads::shared;

my %hash :shared;

function foo {
        my ($key, $value) = @_;
        $hash{$key} = $value;
}

This then returns:

Invalid value for shared scalar at Thread/Manage.pm line 52.
A thread exited while 4 other threads were still running.

It seems as though perl sees $hash{} as a scalar, and not the hash that
was declared above.  Any ideas?

Cheers,

Ray


Reply via email to