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.
In reply to Re: Return a Reference or Array?
by mr_mischief
in thread Return a Reference or Array?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |