use threads; use threads::shared; use Thread::Queue; my %hash; share(%hash); my $scalar; share($scalar); my @arr; share(@arr); # or # my (%hash, $scalar, @arr) : shared; $scalar = "abc"; $hash{'one'} = $scalar; $hash{'two'} = 'xyz'; $arr[0] = 1; $arr[1] = 2; $hash{'three'} = \@arr; my $q = Thread::Queue->new(); # A new empty queue $q->enqueue(\%hash); #### my $hugedata = ; my (%hash) : shared; %hash = process($hugedata); # perhaps filtering or rearranging it into a hash # $hugedata = undef; # <<< if done with it, then unload it, otherwise ... threads->create(...); # ... hugedata is duplicated, %hash is not.