http://www.perlmonks.org?node_id=574749


in reply to Linked lists as arrays: inserting values

splice can insert items in the middle, but yes that'll trigger the same inefficient copying and moving that your slice method incurs. If you're mucking with the middle of your list a lot then yes, you may have a case where a linked list will be more efficient than a native array.

  • Comment on Re: Linked lists as arrays: inserting values