Right. Apologies for answering this again, but I've reread the priginal post, and what I think you actually want is: my ($gene_id, @alternative_ids) = split;
All the rest is just confusing. This replaces from your if ($_ =~ match down to your if ($9 ... line.