in reply to Re^4: Print entire line
in thread Print entire line

It's essentially the same program, with a different comparison:

my $filename = '/Users/Pabli/Desktop/do_human_mapping.gmt'; my $match = 'IL4'; open(my $file, '<', $filename) or die "open: $!"; while (<$file>){ my ($name,$id,@genes) = split /\t/; print $id,$/ if grep/^$match$/, @genes; }

Happy to help, but the hope is that you're working towards being able to construct these lil programs for yourself!