@nums = '0' .. '30'; # change to '000000' .. '999999'; srand; while(@nums){ push(@randnums, splice @nums,int(rand @nums),1); }