perl -MList::Util=shuffle -le 'print join $/, shuffle 1 .. 10' #### sub bag_draw { my $bag = shift; return splice(@$bag, rand(@$bag), 1); }