Syntactic Confectionery Delight | |
PerlMonks |
Re: How to implement Linked Listby GrandFather (Saint) |
on Dec 18, 2006 at 19:50 UTC ( [id://590541]=note: print w/replies, xml ) | Need Help?? |
Perl already has linked lists in effect, they are (as others have suggested) called arrays. The key to unlocking Perl arrays as linked lists is to know about splice. Perl arrays are not constant time node insertion and deletion, but are likely to be fast enough for most purposes and splice is easier to read than a bunch of code fooling around with the 'pointers' a linked list requires. DWIM is Perl's answer to Gödel
In Section
Seekers of Perl Wisdom
|
|