Please bear with me through this explanation of one of Perl's central concepts.
Many expressions have quite different behaviors in list context than they do in scalar context.
The values that a particular expression has in these two contexts might be quite different. Now we'll return to your example. In list context, reverse reverses the order of its arguments, so that the lines come out in the reverse order . In a scalar context, reverse first concatenates all its arguments, to get a single string, and then reverses that string. As you know by now.