use Modern::Perl; my %hash = ( yes => 4, no => 3, maybe => 5, perhaps => 2, ); my @flatlist = map { ($_) x $hash{$_}} keys %hash; say "@flatlist";