##
ID1 20
ID2 100
ID3 10
####
C:\Old_Data\perlp>perl t9.pl o44.txt o55.txt
ID1 50 20
ID2 60 100
ID3 100 10
C:\Old_Data\perlp>
####
#!/usr/bin/perl
use strict;
use warnings;
my %data;
while (<>) { # reads 2 files from @ARGV - filenames are on the command line
my ($id, $val) = split;
push @{ $data{$id} }, $val;
}
for my $id (sort keys %data) {
print join("\t", $id, @{ $data{$id} }), "\n";
}