Hello everybody, thanks for all your comments. On Wed, May 12, 2010 at 11:49:09AM -0400, Hans Dieter Pearcey wrote: > relatively simple "return an array in list context, or an arrayref in scalar > context" often ends up irritating me more than it's worth (including when I > wrote the function that uses wantarray to begin with), just because it's not > how arrays work anywhere else in Perl, or because I have to remember that even > though I got an arrayref when I wrote '$foo = function()', I'll get a list > back
[...] > tl;dr: wantarray often seems intuitive when you write it and then isn't when > you want to use it. When I read this I have to admit that this reflects very well parts of my own experience partly contradicting what I wrote in my introduction. I have been using wantarray in this context sometimes because I thought that then users could get back an array or arrayref depending on what they prefer, but I also found that in the end it caused more trouble than benefit. Lutz