while (my $line = ) { my @columns = split /\|/, $line; push @array1, $columns[1]; # Note the first element [0] is empty push @array2, $columns[2]; push @array3, $columns[3]; } __DATA__ |0|PA|1|||BELL|FRANCIS|D|||1||ANGORA||FLEET|HAMPSHIRE|GU51 2UA|