my %result; my $num = 13; my @array = qw(a b c d e); @result{@array} = map int($num/@array) + $_ < $num%@array, 0..$#array;