in reply to Re^2: looping through a hash and looking up values from another hash
in thread looping through a hash and looking up values from another hash
Works for meuse strict; use warnings; my %hash1 = ( 1=> ["You", "Me", "Him", "Her"], 2 => ["You", "Me", "Hi +m", "Her"], 3 => ["You", "Me", "Him", "Her"]); my %hash2 = ( 1 => 3, 51 => 0, 32 => 1) ; foreach my $keys (keys %hash1){ if (defined $hash2{$keys}){ print join(' ',@{ $hash1{$keys} }), "\t", $hash2{$key +s}, "\n"; } }
You Me Him Her 3
|
|---|