foreach my $key1 ( sort { $a <=> $b } keys %hash1 #main loop