There's some convenience you can provide: You can return an array reference in scalar context, and the array itself in list context:
return wantarray ? @array : \@array;
The the caller can decide which version she wants.
In reply to Re: Return a Reference or Array?
by moritz
in thread Return a Reference or Array?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |