Help for this page

Select Code to Download


  1. or download this
    use List::Util 'shuffle';
    my @numbers = shuffle(1..10);
    my $r1 = pop(@numbers);
    my $r2 = pop(@numbers);
    
  2. or download this
    use List::Util 'shuffle';
    
    my( $r1, $r2 ) = (shuffle 1..10)[ 0, 1 ];