This does not work as good as you might think. One of the limitations of threads::shared is that it is great for exchanging one-dimensional containers, but when you try to work with nested data structures, it becomes rather messy, because the compiler does not know what it needs to exchange.
http://perldoc.perl.org/threads/shared.html#BUGS-AND-LIMITATIONS
So, for starters - you need to assign shared variables as shared. Or at the announcement:
my $ref : shared;
But since you are trying to use a hash
shared_clone ( $ref );
But personally - I would shy away from such things. I do not like shared memory objects and usually prefer to use Thread::Semaphore and Thread::Queue and pass data back and forth in the queue. Storable helps with this, since you can freeze and thaw the data object to be inserted into the queue.
source share