in reply to pushing hash values to an array
Could more simply be written as:foreach $key(keys %h) { push(@arr,$h{$key}); }
If the values contain array references then:push @arr, values %h;
Or if the values contain hash references then:push @arr, map @$_, values %h;
And if you don't know beforehand:push @arr, map %$_, values %h;
push @arr, map ref() eq 'ARRAY' ? @$_ : ref() eq 'HASH' ? %$_ : $_, va +lues %h;
|
|---|