foreach my $file (sort {$a cmp $b} keys %hash) { print "$key \n"; }