# This program is for getting snps and genes open(SNP,"D:\\gsea.chi2")or die("File cant be opened"); ; while($line = ){ @snps = split(/\t/,$line); pop(@snps); foreach $id(@snps){ #print "$id \n"; search($id); } } sub search { $snpid = $_[0]; #print "$snpid \n"; open (MAP,"D:\\gsea1.SNPGENEMAP")or die("File cant be opened"); my @map = ; close (MAP); foreach $mapid(@map){ if ($mapid =~ m/^$snpid/i){ print $mapid; last; } } }