in reply to Hash of hashes question

One comment: add use strict to your code.

%termservers{$key} is wrong, should be written as $termservers{$key}.

You could rewrite that line as follows:
print "3", qq{@{[keys %{$termservers{$key}}]}}, "\n";
Note that the part %{ $termservers{$key} } dereferences an anonymous hash. And the part print qq{@{[ ... ]}} prints the hash keys space separated.