in reply to Re: foreach-loop-local var in sub
in thread foreach-loop-local var in sub
you have changed context and $i is uninitialized within that context and therefor you are going to print zerosNot exactly true. Try with
Update: Do not use numbers for testing behaviour, see Re^3: variable declaration question.foreach (qw(a b)) {
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: foreach-loop-local var in sub
by blue_cowdawg (Monsignor) on Jan 21, 2013 at 16:10 UTC | |
by choroba (Cardinal) on Jan 21, 2013 at 16:13 UTC |