Skip to content

Instantly share code, notes, and snippets.

@masak
Created April 19, 2013 19:43
Show Gist options
  • Save masak/5422713 to your computer and use it in GitHub Desktop.
Save masak/5422713 to your computer and use it in GitHub Desktop.
Shuffle everything but the first element
$ perl shuffle-stuff
1
4
5
8
10
3
2
6
7
9
$ cat shuffle-stuff
use 5.010;
use strict;
use warnings;
use List::Util qw(shuffle);
my @things = 1..10;
@things = ($things[0], shuffle(@things[1..@things-1]));
for my $t (@things) {
say $t;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment