use strict ; use threads ; use threads::shared ; my %hash1 =(1,2, 3,4) ; { lock (%hash1) ; $hash1{1} = foo ($hash1{1}); $hash1{3} = foo ($hash1{3}) }