Reputation: 39
Hi I have an for loop in which I declared another if block and what I want to do is to add to a external $a
variable(external of for loop) in a first scroll of if block +1
, in a second scroll +2
and so on with a while condition to be less than a value. Is there a way to ad a different value at every if block scroll?
Upvotes: 0
Views: 77
Reputation: 385857
So you have something like this?
while (condition) {
...
}
Then all you need is the following:
my $i = 0;
while (condition) {
++$i;
...
}
Upvotes: 2