uno = uno
due = dos
tre = tres
quattro = quatro
cinque = cinco
sei = seis
sette = siete
otto = ocho
nouve = nueve
dieci =diez
####
uno = un
due = deux
tre = trois
quattro = quatre
cinque = cinq
sei = six
sette = sept
dieci = dix
##
##
uno => uno, un
due => dos , deux
tre => tres , trois
quattro => quatro, quatre
cinque => cinco , cinq
sei => seis, six
sette => siete, sept
dieci => diez, dix
##
##
use strict;
use warnings;
use Data::Dump qw(dump);
use Storable; #don't know this yet but let's try soon.
my %hash;
#opening my file handles; adding recommendations with naming extentions
open my $in, '<',"./test_data.txt" or die ("can't open the file:$!\n");
open my $in1,'<',"./test_data1.txt" or die ("can't open file : $!\n");
open my $out ,'>' ,"./test_data_out.txt" or die "can't open the file for write:$!\n";
open my $out1 ,'>',"./test_data_out1_no_match.txt" or die "can't open file for write:$!\n";
while (<$in>){
chomp;
my ($key, $value)= split (/\s*=\s*/); #greedy matching for better regex coverage as per Ken
$hash{$key}=$value;
}
close $in;
while (<$in1>){
chomp;
my ($key,$value) = split (/\s*=\s*/); #splits row into 2 col.
#checks for keys that EXIST in both then prints...?
if (exists $hash{$key}){
print $out "$key => $hash{$key} , $value \n";
} else {
print $out1 "$key => $value \n";
}
}
close $in1;
close $out;
close $out1;