- or download this
my @items = (1,5,6,3,5,2,4);
my $index = 0;
...
do_something($items[$index]);
$index = ($index+1) % @items;
}
- or download this
my @items = (1,5,6,3,5,2,4);
my $index = -1;
...
$index = -1;
}
}
- or download this
sub remove_item
{
...
$index = $#part_1;
@items = (@part_1, @part_2);
}