in reply to using pop a lot
Why do you want to do this? If you want to remove 5 elements without calling pop 5 times you can:
splice @array,$#array-4,5;
(With the usual caveat about $[)
Update: Typical, wait 20 minutes for an answer then two come along at once
If you want to grab 5 items to do something with them you can also do:
my @poped = splice @array,$#array-4,5; my $val0 = $poped[0];
|
|---|