sen has asked for the wisdom of the Perl Monks concerning the following question:
hell monks,
I need in my script, to merge the first element of each inner hash into array, but i didn't get the output what i need. i need the output as @a=(a g h i g h i)
my $s = { 'aa' => { '1' => ['a'], '2' => ['b','c','d'], '3' => ['f'], '4' => ['g'] }, 'bb' => { '1' => ['g','h','i'], '2' => ['s','a','d'] }, 'cc' => { '1' => ['g','h','i'], '2' => ['s','a','d'] } }; my @a= ($s->{aa}->{'1'},$s->{bb}->{'1'},$s->{cc}->{'1'}); print @a;
thanks in advance
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: merging two hashes
by ikegami (Patriarch) on Feb 08, 2006 at 20:53 UTC | |
by Roy Johnson (Monsignor) on Feb 08, 2006 at 22:20 UTC | |
Re: merging two hashes
by pKai (Priest) on Feb 08, 2006 at 21:42 UTC | |
Re: merging two hashes
by jZed (Prior) on Feb 08, 2006 at 21:03 UTC | |
by martin (Friar) on Feb 08, 2006 at 21:39 UTC | |
Re: merging two hashes
by trammell (Priest) on Feb 08, 2006 at 22:34 UTC |
Back to
Seekers of Perl Wisdom