in reply to Re: Extracting common keys present in multiple files
in thread Extracting common keys present in multiple files

This is what I have so far, I know it is a mess. I'm not quite sure if this was the best way to incorporate the test files, but I put them at the bottom under DATA.

#!/usr/bin/env perl use strict; use warnings; my @files = shift foreach my $file (@files) { open my $fh, '<', $file or die "Couldn't read '$file': $!"; while (<$fh>) { my %names; my $name ; my $number; $name = $1; $name = split(',', $files); }; __DATA1___ A12345,23 A22334,100 A22789,44 A10923,89 __DATA2___ A89224,88 A12345,99 A78663,100 A10923,89 Expected output: given 2 matches present and at least one in each file A10923 A12345