in reply to reprise searching two files

I have had a similar problem and solved it using an array of hashes approach.

I would solve your issue using three array of hashes.

Write functions that get your two delimited files into an array of hashes. Something like:

# Function that gets passwordLogins from a text file sub get_loginPasswords { my $filename = shift; my @loginPasswords; open F, "< $filename" or die "Cannot open logins file: $filename \n" +; while (<F>) { chomp; if ($_ =~ /\w+@\w+\.\w+,\w+/) { my ($login, $password); ( $login, $password ) = split( ',' ); my $Login = { login => $login, password => $password }; push @loginPasswords, $Login; } else { die "Error in login file format: $filename "; } } close F; return \@loginPasswords; }
Then do something like follows
for (%fileAArrayOfHashes) for (%fileBArrayOfHashes) if (file A column A matches file b column A) { add the columns you want to %hashC push (@fileCarrayOfHashes,\%hashC)
Sorry, the above syntax may be wrong even where it's not pseudocode, but the general idea should work.

Hope that helps!

thomas.