I have a package with many subroutines that return arrays. In many cases the arrays are a fixed size and small (less than 100 elements). But in some cases the arrays can be very large (greater than 1_000_000). What is the best practice here in terms of returning a reference to the array or the array itself? As a user of the package, I'd rather get an array returned than a reference as there are fewer syntactical hoops I have to jump through to use the result. However, returning very large arrays is not as efficient as returning a reference to an array. Furthermore, if in some cases I return a array and in others I return a reference, then a user of the package might be bothered by the inconsistencies. Do any monks know of a CPAN package that handles this issues well (as an example)?