in reply to Why do I need to shuffle an array by reference?

The only reason the example code uses an array reference is because it was intended to be a subroutine, and it edits the array in-place. If it were passed a simple list, there would be no way for it to "know" what array to edit. In short, the algorithm itself does not need a reference -- it's the subroutine that does.

  • Comment on Re: Why do I need to shuffle an array by reference?