in reply to hash of hashes of lists!!!

You're using the key instead of the hash entry as your reference in your keys statement...
foreach $key (sort keys %$hashOfFiles) { #foreach my $file (sort keys %$key) foreach my $file (sort keys %{$hashOfFiles->{$key}})

--
Mike

Edit: Was using %() instead of %{} to wrap the hash reference. :(