I am new to Perl and this is my first question in this blog hopefully to be solved. 

I am having some text (10-18) files in a folder, I want to read all the files and merge all the files which are having common variables in the Names column along with their Area column for all the files. 
For example : 
file 1.txt 

Name sim Area Cas  

aa 12 54 222  

ab 23 2 343  

aaa 32 34 34  

bba 54 76 65 

file 2.txt 

Name Sim Area Cas  

ab 45 45 56  

abc 76 87 98  

bba 54 87 87  

aaa 33 43 54 

file 3.txt 

Name Sim Area Cas 

aaa 43 54 65  

ab 544 76 87  

ac 54 65 76 

Output should be 

Name Area1 Area2 area3  

aaa 32 43 54  

ab 23 45 76 

Can anyone help regarding this. I am a very new to Perl and struggling to use Hashes. 

I have tried this so far 

```
use strict;
use warnings;

my $input_dir = 'C:/Users/Desktop/mr/';
my $output_dir = 'C:/Users/Desktop/test_output/';

opendir SD, $input_dir || die 'cannot open the input directory $!';
my @files_list = readdir(SD);
closedir(SD);

    foreach my $each_file(@files_list)
    {
        if ($each_file!~/^\./)               
        {
            #print "$each_file\n"; exit;
            open (IN, $input_dir.$each_file) || die 'cannot open the inputfile $!';
            open (OUT, ">$output_dir$each_file") || die 'cannot open the outputfile $!';

        print OUT "Name\tArea\n"; 

            my %hash; my %area; my %remaning_data;

            while(my $line=<IN>){
            chomp $line;

            my @line_split=split(/\t/,$line);
            # print $_,"\n" foreach(@line_split);

            my $name=$line_split[0]; 
             my $area=$line_split[1]; 
                }
            }   
        }

```

Can anyone provide guidance on how to complete this?
Thanks in advance.