in reply to Return a Reference or Array?
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.
|
|---|