in reply to Re^4: Unobvious Pathological Code Snippets
in thread Unobvious Pathological Code Snippets
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Unobvious Pathological Code Snippets
by xdg (Monsignor) on Mar 28, 2006 at 23:16 UTC |