for(@filearray1){ ($col1)=split; push@colarray1,$col1; } for(@filearray2){ ($col1)=split; push@colarray2,$col1; }