in reply to Hashes, File sizes, Translations, OH MY!
Next, to output them in alphabetical order:%language = (English => 'en', German => 'de', French => 'fr');
Lastly, you could implement the output that you want in a couple of different ways. The first is store all of the file information in a hash of arrays, indexed by ANSI language code. Then, in the foreach loop that I have above, you'd do a hash lookup and process the contents of the array that lives there. This has the disadvantage of having to store all of the information for all files in memory before you output. The second method that I can think of is to alter your find subroutine to search for files of a specific language. You'd call it in your foreach loop. The disadvantage here is that you walk your file tree once for every language. I'm sure that there are other ways to do it, though.foreach my $key (sort {$a cmp $b} keys %language) { print "$key has '$language{$key}' as the ANSI value\n"; }
thor
|
|---|