%ids; #loop through lines #add id to the list $ids{$my_input_id} = 'anything - doesn't matter'; #end loop @ids = keys %ids join(',' @ids);