If you have "my" inside the loop, it makes perl create a new lexical every time around -- and throws out the previous one.
Try turning on "use diagnostics;" to see more info about the problem.
In reply to Re: Syntax error - "my" within foreach loop
by rudder
in thread Syntax error - "my" within foreach loop
by Klammer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |