#!/usr/bin/perl use strict; use warnings; my $outfile = "HUGO_dummyResults.txt"; open( OUT, "> $outfile" ) or die "cannot create the output file"; open (DUMMY_GENEFILE, 'DummyGenes.txt') or die "cannot open file containing genes"; open (DUMMYHUGO,'DummyHugo.txt') or die "cannot open file containing HUGO IDs"; ################################################# #Operations ################################################# #make array HUGO my @hugo = ; foreach () #Changed from () { #make array genes my @genes = split ( /\b/, $_ ); foreach my $i ( 4 .. 7 ) { if ($genes[2] eq $hugo[$i]) { print OUT "$genes[0]\t$genes[1]\t$genes[2]\t$genes[3]\t$hugo[1]\n"; } print OUT "$genes[0]\t$genes[1]\t$genes[2]\t$genes[3]\tNo HUGO ID\n"; } } close (DUMMYHUGO); close (DUMMY_GENEFILE); close (OUT); exit;