Help for this page

Select Code to Download


  1. or download this
    use List::Util 'shuffle';
    @shuffled = shuffle(@list);
    
  2. or download this
    sub fisher_yates_shuffle {
        my $deck = shift;  # $deck is a reference to an array
    ...
    my @mpeg = <audio/*/*.mp3>;
    fisher_yates_shuffle( \@mpeg );    # randomize @mpeg in place
    print @mpeg;