#!/usr/bin/perl-w use strict; use warnings; use List::MoreUtils qw(uniq); my %gene2TF2val = (); my @TF = (); while(<>){ chomp; my @s = split /\s+/,$_; push @TF , $s[1]; # pushing every TF into array @TF but this is still not unique list of transcription factors. $gene2TF2val{$s[1]}->{$s[0]} = "-"; } @TF = uniq @TF;