for my $city ( keys %$location_hash ) { . . . printf "Before deleting: state=%s zip= %s\n", $location_hash->{ $city }->{ 'ST' }, $location_hash->{ $city }->{ 'ZIP' }; delete ($location_hash->{ $city }); ### delete ($location_hash->{ $city }->{ 'ST' }) ; ### delete ($location_hash->{ $city }->{ 'ZIP' }) ; printf "After deleting: state=%s zip= %s\n", $location_hash->{ $city }->{ 'ST' }, $location_hash->{ $city }->{ 'ZIP' }; } end for loop