If I was doing it in pedestrian way I would make two hashes. One - straight hash for T-names. The other would be hash of hashes with - keys would be gene-names and values would be hashes indexed by T-names.
Loop through data collecting all T-names encountered into first hash. And setting all the "+" values in the second hash - e.g. if "geneA T2" then set gene_present{geneA}->{T2} = '+'
Then loop through all the gene names in gene_present keys and all the keys in T-name hash, check if T-name key exists in gene_present hash - if not set it to '-'.