SELECT file1.name,address FROM file1, file2 WHERE file1.name = file2.name AND rank = 'General'; #### while () { chomp push @table1,[ split /\s+/ ]; } #### my @join; for my $i (@table1) { for my $j (@table2) { push @join,@$i,@$j; } } #### my @select; for $i (@join) { push @select,$i if ($i->[0] eq $i->[3]) and ($i->[1] eq "Joe"); } #### my @project; for $i (@select) { push @project,[ $i->[0,2,4] ]; }