in reply to Get the length of a list.
Another way, though not necessarily better than the original.
But if other processing is going to be done with the list, might as well just make a named array out of it from the start.print scalar map $_, (1, 2, 3, 4, 3, 2, 1);
|
---|
In Section
Seekers of Perl Wisdom