Documentation for routine pick

Documentation for routine pick, assembled from the following types:

List.pick

From List

pick

multi sub    pick($count, *@list) returns List:D
multi method pick(List:D: $count = 1)

Returns $count elements chosen at random and without repetition from the invocant. If * is passed as $count, or $count is greater than or equal to the size of the list, then all elements from the invocant list are returned in a random sequence.

Examples:

say <a b c d e>.pick;           # b
b
say <a b c d e>.pick: 3;        # c a e
say  <a b c d e>.pick: *;       # e d a b c

Baggy.pick

From Baggy

pick

Setty.pick

From Setty

pick

method pick($count = 1)

Returns $count elements chosen at random and without repetition from the Setty object.