in reply to Re: Idiomize This - Hash to Array of Hashes
in thread Idiomize This - Hash to Array of Hashes

The push isn't necessary here no?
my $speedlist = ....; my @cmd_choices = map {{-name=>$_, -value=>$speedlist->{$_}}} keys %$s +peedlist;

Replies are listed 'Best First'.
Re^3: Idiomize This - Hash to Array of Hashes
by johnr (Acolyte) on Apr 20, 2009 at 01:24 UTC
    Thanks to both of you:
    my $speedlist = $heap->{config}{freq_gui}{speedlist}; my @cmd_choices = map {{-name=>$_, -value=>$speedlist->{$_}}} keys + %$speedlist;
Re^3: Idiomize This - Hash to Array of Hashes
by jettero (Monsignor) on Apr 20, 2009 at 10:04 UTC
    It wasn't clear to me if the @cmd_choices already had data in it. If it did, the push was necessary, otherwise, no.

    -Paul