Title says what I need help with. I want to create a random integer within a loop that does not repeat. So that means within a range of 4 for example, I would recieve only 0, 1, 2 or 3 in any order, but not two instances of the same number. The desired output would be this: 3,1,2,0 The number must not repeat at the next iteration of the loop either. I have tried using Math::rand%3 and adding a temp variable that checks the previous value of the random integer (during the previous loop interation) but it appears that the value of the temp value becomes garbage once the loop restarts itself. Can anyone help? Thanks!