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.
In reply to Re: Nodes count in Linked List
by LanX
in thread Perl linked list
by Perl_is_Perl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |