in reply to using pop a lot

Just for variety...

perl -le"$,=' '; @a=(1..10); print 'start with ', scalar @a, ' delete 5 [', delete @a[-5..-1], '] leaves ', scalar @a" start with 10 delete 5 [ 6 7 8 9 10 ] leaves 5

Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail