in reply to Perl linked list
Each node is a two element array [value,tail_ref] with tail_ref being an array ref to the next node or undef.
To count length iterate through the list till you get undef.
Perl has no built in linked lists b/c arrays cover almost all use cases.
|
|---|