#so replace this push (@{$site{$key1}{$key4}},$key4); #with $site{$key1}{$key4}++;