in reply to aliasing
To add to what others already mentioned--according to perldata, these two statements are exactly equivalent:
@a[0,2,4] = (0 .. 2); ($a[0], $a[2], $a[4]) = (0 .. 2);
So the slice is modifying the elements directly, but the assignment to a plain array clobbers that array.
Update: Spelling error fixed. Thanks cLive ;-).
----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer
: () { :|:& };:
Note: All code is untested, unless otherwise stated
|
|---|