The stupid question is the question not asked | |
PerlMonks |
Re: 'prev' in for loopby gjb (Vicar) |
on Dec 06, 2005 at 14:28 UTC ( [id://514467]=note: print w/replies, xml ) | Need Help?? |
prev simply isn't Perl. next and last are though. You can always rewrite a for-loop from: to By modifying $i you can get to the "previous" iteration (something like $i--. However, be careful not to create an infinite loop. Hope this helps, -gjb-
In Section
Seekers of Perl Wisdom
|
|