use strict; use warnings; use Digest::MD5 qw(md5_hex); my @li = ('a'..'z','a'); shuffle(\@li) for 1..5; print "@li\n"; sub shuffle{ my $ref = shift; my @idx = 0 .. scalar @$ref -1; @$ref = map{ $ref->[$_->[0]] } sort{ $a->[1] cmp $b->[1] } map{ [ $_, md5_hex($_.$$.time) ] }@idx; }