$#stack1 is the index of the last element of the array @stack1. But the stack size is arguably the length of the array, which is given by @stack1 in a scalar context (i.e, scalar @stack1 to be unambiguous).
Happy Perl-ing.
In reply to Re: using foreach
by broomduster
in thread using foreach
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |