my %sorted_reads=(); foreach my $hit_file (@hits){ open(HITS, "<".$hit_file); my @hit = ; foreach my $line (@hit){ chomp($line); next unless($line); my ($name,$start,$stop,$direction,$align_q,$align_s,$error) = split /\t/, $line; %sorted_reads($name => $error); } }