Salve o código como arquivo mergecols , torne-o executável e inicie-o com
mergecols -C1=0,2,3,4 -C2=0,2,1,3 file1 file2
#!/usr/bin/perl -s
# mergecols
# -C1=0,2,3,4 columns from file 1
# -C2=0,2,1,3 columns from file 2
# file1 input file 1
# file2 input file 2
($f1,$f2) = @ARGV;
@t1 = map { [split] } do { local @ARGV=($f1); <> };
@t2 = map { [split] } do { local @ARGV=($f2); <> };
@c1 = split /,/, $C1;
@c2 = split /,/, $C2;
for ( $i=0; $t1[$i] or $t2[$i]; $i++ ) {
print join ' ', @{$t1[$i]}[@c1], "\n" if $t1[$i];
print join ' ', @{$t2[$i]}[@c2], "\n" if $t2[$i];
}