my @files = sort { $hash{$a} <=> $hash{$b} } keys %hash;