use strict; use warnings; my @li = ('a'..'z','a'); shuffle(\@li) for 1..3; sub shuffle{ my $ref = shift; my @idx = 0 .. scalar @$ref -1; @$ref = map{ $ref->[$_->[0]] } sort{ $a->[1] cmp $b->[1] } map{ [ $_, crypt(pack("V",$_),$$) ] }@idx; print "@$ref\n"; }