in reply to I've never seen this before - $#a = 4 - ??

$#a is the last index of the array @a. setting it to something lower than what it already is will truncate the array.
@a = (0..10); print join(" ", @a), "\n"; $#a = 5; print join(" ", @a), "\n";
0 1 2 3 4 5 6 7 8 9 10
0 1 2 3 4 5