foreach my $line (@lines){ @lineFields = split( ' ', $line ); } #### #get the comman separated list of genes my @geneItems = split( ',', $lineFileds[3] ); #now look at each one in turn foreach my @item ( @geneItems ){ #just continue processing and store in hash }