#!/usr/bin/perl -w use strict; use warnings; use Getopt::Std; my $file = "lethal_results2.txt"; # input file containing nubiscan results my $ge = "geneid.txt"; # file with TE name and length open(FILE,"<",$file) or die("Unable to open file $file: $!"); open(GE,"<",$ge) or die("Unable to open $ge: $!"); my @file_data = ; my @ge_data = ; #input stored in an array close(FILE); close(GE); foreach my $line (@ge_data) { my @line = split(/\s+/,$line); my $start = $line[0]; #print"$line[0] \n"; foreach my $values(@file_data) { my @values = split(/\s+/, $values); my $id = $values[0]; #print"$values[0] \n"; my $width = 11; if ($values[0] eq $line[0]) { #print"the gene id \n"; print"$line[0] \n"; } } }