On Wed, May 12, 2010 at 11:32:59AM -0700, Eric Wilhelm wrote: > That might be simple, but no builtins do this, which seems to say > something. If you're still working with lists, you expect them to > behave like lists, and not try to package themselves in a reference
The following comment has admittedly not much to do with wantarray any more, but I would still like to point out that returning array references can make sense sometimes, e.g. when the referenced list is very big. Of course, returning the internal reference to the list bears the danger of the user messing up the object's internals, but if this behaviour is well documented the gain in CPU and memory efficiency might be worth the loss of encapsulation. Best wishes, Lutz