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.
In reply to Re: Why do I need to shuffle an array by reference?
by revdiablo
in thread Why do I need to shuffle an array by reference?
by ajdelore
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |