@random=(0,1,2,3,4);
@array = (0,1,2,3,4); $c = $#array; foreach(0 .. $c){ $idx = rand($#array+1); $res .= $array[$idx]; splice(@array,$idx,1); }