Help for this page

Select Code to Download


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