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
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