in reply to Re: looping through a hash and looking up values from another hash
in thread looping through a hash and looking up values from another hash

i've fixed the sigil issue but still doesn't print anything..it should print..
  • Comment on Re^2: looping through a hash and looking up values from another hash

Replies are listed 'Best First'.
Re^3: looping through a hash and looking up values from another hash
by huck (Prior) on Apr 26, 2017 at 03:31 UTC

    use 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"; } }
    Works for me
    You Me Him Her 3