use warnings; use strict; use Data::Dumper; my %HoH = ( first => {1 => 'First 1', 2 => 'First 2'}, second => {1 => 'second ', 2 => 'second 2'}); print "Original hash: " . Dumper (\%HoH); my %newHoH = %{inAndOut (%HoH)}; print "\nnew hash: " . Dumper (\%newHoH); sub inAndOut { my (%hash) = @_; print "\nin sub: " . Dumper (\%hash); return {%hash}; }