perlfaq nodetype
faq_monk
<P>
In general, you usually don't need a linked list in Perl, since with regular arrays, you can push and pop or shift and unshift at either end, or you can use splice to add and/or remove arbitrary number of elements at arbitrary points. Both pop and shift are both
<CODE>O(1)</CODE> operations on perl's dynamic arrays. In the absence of shifts and pops, push in general needs to reallocate on the order every
<CODE>log(N)</CODE> times, and unshift will need to copy pointers each time.
<P>
If you really, really wanted, you could use structures as described in
[perlman:perldsc|the perldsc manpage] or [perlman:perltoot|the perltoot manpage] and do just what the algorithm book tells you to do.
<P>