in reply to Pulling out data from one file thats not in another

The problem with your code is that your getComData sub does not populate your hash ref as you expect it to. Prove this to yourself by printing the data structure using Data::Dumper (Tip #4 from the Basic debugging checklist):
use Data::Dumper; print Dumper($hComData);

Your sort looks very strange:

my ($chn, $ex) = sort ($hEntry->{chain}, $hEntry->{exists});

If you don't need a Hash-of-Hashes, just use a simple hash.