@a = split /\s+/, join " ", ("1 " x 8, "2 " x 1, "3 " x 1); print $a[int(rand 10)]; #### my %wheel = {"One" => 8, "Two" => 1, "Three" => 1}; my $sum; my $item; foreach $item (keys %wheel) { $sum+=$wheel{$item}; } my $spin = int(rand($sum)); foreach $item (keys %wheel) { last if $sum < $wheel{$item}; $sum-=$wheel{$item}; } print "$item was picked\n";