note
Melly
<p>I don't know how well it would scale, but I'd build a hash from the first file ($objects{'object1'}=23.12;), then scan the second file. If the object in the second file has a defined hash, then print out the hashkey and both values..</p>
<p>Untested code... and I'm assuming a space delim. as per your examples..</p>
<code>
open(FILE, "file1");
while(<FILE>){
if(/(\S+)\s+(\S+)/){
$hash{$1} = $2;
}
}
close FILE;
open(FILE, "file2");
while(<FILE>){
if(/(\S+)\s+(\S+)/){
print "$1: $hash{$1} $2\n" if defined $hash{$1};
}
}
</code>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-66612">
Tom Melly, tom@tomandlu.co.uk
</div></div>
575187
575187