I tried to find a solution by extensive googling, but didn't get a good solution so far.

Problem: I run throw big files and save hits in a big hash file. Acccording to the files name, they are saved as %bighash{hitname}{filename} whereas scores are subclassed as %bighash{hitname}{filename}->{score}.

This means that lateron, I get a big hash with 'hitname' entries that do not contain entries for all the files. I wanna sort then the enrtries coming from only one file by using a code as follows:

The problem is then that for some keys of the hash, the subhash is not defined and perl grumbles since the sort is supposed to sort non defined values. Is there a way to exclude the not defined parts of the hash properly?

ideally, i would like to have a sort that would follow this logics: foreach $value ( sort ... ) keys %hash{.*}{'filename'}

i found some hints about hash slices etc, but i would like to keep all the entries within one big hash for different reasons...

(by the way, i know that i should rather leave the loops when reaching 50 instead of looping throw the whole thing)

hi, thanks for your help. i tried your hint out, but did not get it working inside the sort syntax... even after googling for the Schwartz transformation. do you talk about putting it inside my code, or in a isolated loop? could you help me to precise your solution? my only aim is to get rid of the comparisons for the keys where the value to be compared is not defined...

You seem to have solved the stated problem, but I suspect that the "missing" data will be a problem later in the program. Do you see a problem with using grep (before the sort) to select only those keys which do have data for the current file? I am not prepared to recommend this without a second opinion. Good Luck, Bill