See Juerd's original thread: Non-destructive array processing for some explanation/discussion.
How it works, as I understand, and anyone knows better, please correct me.
When you pass an array to a sub, each of the elements of @_ is alias to the elements of the original array. As the destructive manipulations are applied to @_ rather than the original array, the original array and it's contents remain untouched by the process.
In reply to Re^5: Unobvious Pathological Code Snippets
by BrowserUk
in thread Unobvious Pathological Code Snippets
by QM
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |