use strict; use warnings; my @AoA = ( [0..13], [0..11], [0..11] ); fisher_yates_shuffle(@AoA); foreach ( @AoA ) { print join ",",@$_; print $/; } sub fisher_yates_shuffle { while (my $deck = shift ) { my $i = @$deck; while ($i--) { my $j = int rand ($i+1); @$deck[$i,$j] = @$deck[$j,$i]; } } }