#!/usr/bin/perl -w

$file1=$ARGV[0];
$file2=$ARGV[1];

open IN1,$file1;
while (<IN1>)
{
	chomp;
	($cle,$valeur)=split(/\t/,$_);
	$hash1{$cle}=$valeur;
}
close IN1;

open IN2,$file2;
while (<IN2>)
{
	chomp;
	($cle,$valeur)=split(/\t/,$_);
	$hash2{$cle}=$valeur;
}
close IN2;
$nb1=keys %hash1;
$nb2=keys %hash2;
print STDERR "$nb1\n$nb2\n";

foreach $cle (keys %hash1)
{
	if ($hash2{$hash1{$cle}})
	{
		print "$cle\t$hash1{$cle}\n" if ($hash2{$hash1{$cle}} eq $cle);
	}
}
