At 03:26 PM 7/22/02 +0200, Arthur Bergman wrote:
>>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 then returns:
>>Invalid value for shared scalar at Thread/Manage.pm line 52.
>>A thread exited while 4 other threads were still running.
>Aside from the fact that $hash{$key} is a scalar :-), if $value is a 
>reference it needs to be shared for the assign to work.

Which I understand why, but which I think is _the_ stumbling block with the 
current threads implementation.  And which is something _everybody_ will 
bang their head against when they start programming threads...  ;-(

Ray, for what it's worth: I get around that by serializing any values with 
Storable::freeze and then retrieving the value later again with 
Storable::thaw.  Maybe a future version of Perl might make this process 
automatic, or maybe we could create a tie-able class for hashes, arrays and 
scalars.  Would that work, Arthur?


Liz

Reply via email to