in reply to Re^5: Need advice on checking two hashes values and keys
in thread Need advice on checking two hashes values and keys
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;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^7: Need advice on checking two hashes values and keys
by aaron_baugher (Curate) on Jun 09, 2015 at 20:52 UTC | |
by Anonymous Monk on Jun 10, 2015 at 00:15 UTC | |
by aaron_baugher (Curate) on Jun 10, 2015 at 00:37 UTC | |
by AnomalousMonk (Archbishop) on Jun 10, 2015 at 02:21 UTC | |
by Anonymous Monk on Jun 10, 2015 at 23:53 UTC | |
by perlynewby (Scribe) on Jun 11, 2015 at 19:33 UTC | |
by aaron_baugher (Curate) on Jun 11, 2015 at 20:25 UTC |