Your statement :
@bar expands to a list of its elements, with anonymous undefined values in place of nonexistent elements
is negated by the code I posted. If "nonexistent elements" were indeed passed, assigning values to the corresponding aliases would vivify, in the original array. This is not the case.
The only elements that can get persistent new values from inside the sub are "existing" elements, or explicitly passed elements, as Jenda indicated.
I agree that it would be crufty to take advantage of this in production code. I also think this behaviour is "correct", and sufficiently documented for most code, and can be persuaded that since the behaviour is subject to change, it should not be encouraged/documented. I'm just trying to understand what the behaviour is, and trying to ensure that I have not mis-understood it.
"An undefined problem has an infinite number of solutions." - Robert A. Humphrey "If you're not part of the solution, you're part of the precipitate." - Henry J. Tillman
In reply to Re^7: perlsub question..
by NetWallah
in thread perlsub question..
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |