Unfortunately, even the squeeze operator will still build a long list then discard it, in order to count its members.
More efficient would be:
my $entries = -2; ++$entries while readdir $dh;
In reply to Re: forcing list-context
by BrowserUk
in thread forcing list-context
by morgon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |