in reply to How compare two files

The short answer is: use a hash, keyed by the values that you want to test for equality. Something like:
for (@fuente) { my @parts = split /\|/; ++$seen{$parts[1]} = $_; } for (@fuente2) { my @parts = split /\|/; if ($seen{$parts[2]}) { print $seen{$parts[1]}; # That's the matching line from @fuente print; # That prints the line from @fuente2 } }

The PerlMonk tr/// Advocate