Re: remove last n elements from array and return the rest

2001-09-24 Thread Jeff 'japhy/Marillion' Pinyan
On Sep 25, birgit kellner said: >Is there a simpler way than this to remove the last n elements of an array >and to reassign same array to the remainder? You probably want to do: splice @array, 0, @array - 3; -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ R

remove last n elements from array and return the rest

2001-09-24 Thread birgit kellner
Is there a simpler way than this to remove the last n elements of an array and to reassign same array to the remainder? my $delete_last_elements = 3; print "array before removal of last $delete_last_elements elements\n"; my @searchwords = qw(one two three four five six seven eight); foreach (@se