in reply to array splicing

I often use splice to grab more than one item out of a list at a time. E.g. instead of:
for my $x (@list) { do something with $x }
you can do
while (my ($x,$y) = splice(@list, 0, 2)) { do something with $x and $y }
Of course, the latter destroys the list as it iterates over it.

Did you have specific questions about offset and length that aren't answered in the fine manual?

With the above while loop, changing to splice(@list, -2) will grab $x and $y off the end of the array instead of the beginning (though that way will die if @list has an odd number of elements instead of just getting an undef $y).

May I suggest a super search of splice to see many different ways of using it?

Update: said slice where meant splice.