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 (@searchwords) {print "$_\n";}
print "------------------------\n";
my $delete_last_elements = 3;
my $remaining_elements_number = @searchwords-$delete_last_elements;
@searchwords = splice (@searchwords, 0, $remaining_elements_number);
print "array after removal of last $delete_last_elements elements\n";
foreach (@searchwords) {print "$_\n";}
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]