in reply to Return a Reference or Array?
Another way to help avoid the confusion is to, as mentioned already, return the ref in scalar context and the array in list context consistently across all your data-returning methods or subs and to document the fact that it is always that way across the whole API as part of your API documentation.
|
|---|