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. |