Help for this page
for my $idx (reverse 0 .. $#array) { my $item = $array[$idx]; ... splice(@array, $idx, 1); # remove the element } }
while (@work) { my $item = shift/pop @work; # Possibly push/unshift items onto @work }