I think that I'm missing something fundamental here... isn't for the third element of @array grep {@$_} @arrays yielding grep { 1,2 } @arrays when dereferenced?
I think perhaps the fundamental thing is that in Perl, arrays are different from lists. Lists and the comma operator are one way of several to initialize an array, as in my @array = ("a","b","c");, but once those items are stored in the array, the comma operator is no longer relevant; @array is not the same as the literal expression ("a","b","c") any more, including for dereferenced array references. An array in scalar context returns the number of elements it contains, and grep provides scalar context to its expression, so grep {@$_} @arrays is equivalent to grep {scalar(@$_)} @arrays, and scalar(@$_) yields 2 for the element [1, 2]. That's not because 2 is the last item in the list, but because there are 2 items in the listarray.
In the example code, try replacing @arrays = ( [], [1], [ 1, 2 ], [], [ 5 .. 9 ] ); with @arrays = ( [], ["a"], ["b", "c"], [], ["d".."h"] );, and the functionality will be the same. Then, try replacing it with @arrays = ( [], [0], [0, 0], [], [0,0,0,0,0] ); (a bunch of false values) and it will still work the same. scalar(0,0,0) is false, because it returns the last value of the list, 0, which is false, but my @x=(0,0,0); scalar(@x) is true, because the array @x evaluates to 3. That's how the grep works here.