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


in reply to Linked list in Perl

In Perl I create linked lists like:

my @list;

I can then append at the front with unshift or the back with push. I can remove from the front with shift and from the back with pop. I can insert at any index position with splice using splice @list, $iPoint, 0, $item and remove an item anywhere from the list with my ($delItem) = <c>splice @list, $dPoint, 1. Actually I can add multiple items in a single operation using any of push, unshift or splice by using a list instead of a single item and I can use splice to remove multiple contiguous items anywhere from the list.

Was there something you want to do with a linked list that isn't included in the box with Perl?

True laziness is hard work