By assigning the list to an array, you force the list to lose its list "magic", so that evaluating it in a scalar context no longer returns the last value but the number of elements.
Reread perlman:perldata more carefully :) In fact, the answer is in the last quoted section above!
In reply to Re: Arrays: Last-index special variable vs. scalar values
by snax
in thread Arrays: Last-index special variable vs. scalar values
by mwp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |