sub thread_worker { my $n = shift; # thread N my @args = shift; my %temp : shared = (); # Make shared $totals{$n}->{STEPS} = 0 ; # Nothing yet $totals{$n}->{HASH} = \%temp ; # Set ref to shared results .... while(1) { .... $totals{$n}->{STEPS} = $s; # record step $temp{$s}=$random; # add value to per-thread hash # REMOVED: $totals{$n}->{HASH}= &share( \%temp ); .... } }