Your skill will accomplish what the force of many cannot |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Actually a simple splice/push will not change the position of an element in an array, it will create a new element that comtains a copy of the value from the old of element.
Had $array[1] been moved to the end of the array then $$ref_to_element would point to $array[2] after the move. Admittedly, this is usually not an issue. On the rare occasions when you really want to move elements of an array use Array::Splice. In the above example you would use push_aliases() in place of the built-in push(). In reply to Re^2: changing the position of an element in an array
by nobull
|
|