Just because @argv is passed by reference, it doesn't always mean that @argv will be modified for you to read the changes. @argv is probably passed by reference simply to prevent the copying of a potentially long list of values or perhaps to make the API for that function easier to change/extend or even to make it possible to detect certain usage mistakes (or perhaps due to all of the above).
In the Unix 'spawn' interface (see exec and/or "man exec"; 'spawn' also involves fork but that part doesn't affect 'argv') argv is clearly copied to the program being invoked and not copied back.
- tyeIn reply to Re: passing argv by reference (copy vs. output)
by tye
in thread passing argv by reference
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |