A sub never returns an array _directly_, but it can return arrays by reference, along with anything else it wants to return, in its list of return values.
Well, duh. That's like responding to someone who says "you can't make trees with a camera, just pictures" with "but you can make a picture of a tree!".
The whole problem of the OP deals with the fact subs return lists, not arrays. The fact that a list element can be a reference to an array is an interesting observation in its own right - but not for this discussion.
The OP may have meant that the sub returns a list of whatevers, or he might have meant that it returns an array reference.
The code never uses references. Both the comment and the code show that the OP expected
@array to be empty. It's pretty clear to me what the OP expected, and where the OP went wrong.
Abigail