How about chucking the $index and rotating the array (shift and push) every time you get an element (which is now always the first)?
remove is now as trivial as it ought to be:
sub remove { my %del = map { $_ => 1 } @_; @items = grep { not $del{$_} } @items; }
— Arien
In reply to Re: round-robin on varying sequence
by Arien
in thread round-robin on varying sequence
by dpuu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |