I'm suprised no one has mentioned it yet, but List::Util has a shuffle() method that does just that.
use List::Util qw( shuffle ) ; my @arr = qw( a b c d e f A B C D E F ) ; print( ( map { "[$_]" } @arr ), "\n" ) ; for ( 1..5 ) { print( ( map { "[$_]" } shuffle @arr ), "\n" ) ; }
Those who know that they are profound strive for clarity. Those who
would like to seem profound to the crowd strive for obscurity.
--Friedrich Nietzsche
In reply to Re: Shuffle an array
by DamnDirtyApe
in thread Shuffle an array
by FireBird34
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |