in reply to array splicing

If you only want to keep the first three elements of an array, you'd use splice(@array, 3); or as an alternative to using pop(@array); you could use splice(@array, -1); since a negative offset means to start that many places from the end of the array. You have to remember that there is always more than one way to do anything with perl.

Length refers to the number of positions to splice, so to remove the fifth and sixth postitions from an array, use splice(@array, 4, 2);

If this isn't as clear as mud, take a longer look at Programming Perl or Perl in a Nutshell.