http://www.perlmonks.org?node_id=528928

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