|
|
| The stupid question is the question not asked | |
| PerlMonks |
Re: Variable scope in while loopby Athanasius (Vicar) |
| on Dec 20, 2012 at 02:37 UTC ( #1009671=note: print w/ replies, xml ) | Need Help?? |
|
Hello euswdwj, and welcome to the Monastery! In the case where the scope of the loop variable does not need to extend beyond the loop itself, a C-style for loop may be preferable to the more usual while:
Sample run:
Hope that helps,
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||