in reply to Unusual (and pointless?) idiom in old code

The second parameter for splice, OFFSET, is called in scalar context, so @foobar just returns the number of elements. Using that count as the offset will indeed return an empty list.

I think the original idea behind this idiom was to keep a number of elements, for example, 3, from the end of the array, and probably into a different variable, removing them from the original array:

@trailing = splice(@foobar, @foobar-3);
(which is the same as
@trailing = splice(@foobar, -3);
but that won't work for 0)
which was later adapted to return nothing, and probably who didn't quite grasp how it worked.