I have corrected my piece of code with our help.
After this is completed then I will add more numbers/complexity to make a list of list program. will add German and English in random order then check for keys and values.
then moving to hash tables as per earlier suggestion
I understand why I can not use the push function(due to french word in place of Spanish , if no Spanish word found)
Still, I see a PROBLEM with my unless section. I am coming up with an empty matrix. trying to use only one hash...
while(<$in1>){ chomp; my ($ita,$fran)=split /\s*=\s*/; #diventa in due colonne $hash{$ita}[1]=$fran; #salva i numeri francesi al loro posto [1] #se i numeri esiste in ambe matrice if ($hash{$ita}[0] and $hash{$ita}[1]){ print $out "$ita =>",join(',',@{$hash{$ita}}),"\n"; } else { print $out1 "$ita =>", join(',',@{$hash{$ita}}),"\n"; } } close $in1; close $out; close $in1;
In reply to Re^6: Need advice on checking two hashes values and keys
by Anonymous Monk
in thread Need advice on checking two hashes values and keys
by perlynewby
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |