Missing $ sigils aside: In the first example $item is visible outside and after the for BLOCK; in the second $item is only visible within the for BLOCK.
In reply to Re: Scoping of my with foreach loop
by Fletch
in thread Scoping of my with foreach loop
by uksza
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |