foreach my$key (sort {$hash{$a}->[0] <=> $hash{$b}->[0]}keys %hash)