print "3", keys(%{$termservers{$­key}}), "\n"; should be this: print "3", keys(%{$termservers{$­key}), "\n";