in reply to nonempty false list

Neither produce lists. The if statement provides scalar context.

In the first case, we have a slice - and the last element of the slice is the return value. Which is undefined. The second case has an array in scalar context. Which produces the number of elements (2 in this case).