http://www.perlmonks.org?node_id=1008477


in reply to Re: Recursive loops
in thread Recursive loops

In that case, you don't even need a queue. To restate your description of the process:
While subA detects faults, use subB to correct them.
Translating this to Perl is trivial:
while (subA(@array)) { subB(@array); }
or
while (my @faults = subA(@array)) { subB(\@array, \@faults); }
if subB needs to know what the list of faults was.