use threads; use threads::shared; my $hash = &share({}); my $obj = 'foo'; $hash->{thing} = $obj; Right? Fine, no complaints. use threads; use threads::shared; my $hash = &share({}); my $obj = bless {}, 'Foo'; $hash->{thing} = $obj; "Invalid value for shared scalar at ... line 8." From my PoV (ie. I don't want to care about threads) why doesn't Perl just figure it out? Why do I have to remember to share every reference I assign to a shared hash? Even if there's a good reason, it still makes working with them a pain in the ass. There's also an encapsulation piercing. This problem shows up in Test::Builder. If you try to feed it an object with stringification overloaded for the test name it will blow up because Test::Builder assigns the object (which it thinks is a string) to the shared hash of test results. Part of the point of overloading stringification is to hide the fact that its an object. Now I've got to explicitly force stringification to avoid putting an unshared object onto a shared hash. Just make the bad things go away. -- Michael G Schwern schwern@pobox.com http://www.pobox.com/~schwern/ My breasts are arousing weapons.Thread Next