http://qs321.pair.com?node_id=1096933


in reply to Re^4: Looking for the first item in the chain
in thread Looking for the first item in the chain

The $continue variable is just there to control the while loop. The idea is that you have to iterate on a data structure an unknown number of times. So long as you make a change, it means that further changes might be needed. But it you did not need to make any change, then you are guaranteed that you will not need to make any further changes. So you set $continue to true (1) before the loop, to make sure you enter the loop at least once. Then, you immediately set it to false (0). And, if you had to make any change, you set it to true (1), because you might have to iterate once more. But if you didn't need to make any change, then you are done, all the required changes have been done.

Another monk previously called the same variable "changes" in another answer to this thread, but $changes and $continue have essentially the same purpose.

Replies are listed 'Best First'.
Re^6: Looking for the first item in the chain
by vagabonding electron (Curate) on Aug 16, 2014 at 14:48 UTC

    Sorry for late responce and thank you very much again!