In general if you get into the whole map, grep, etc frame of mind then returning lists is better than refs. Returning refs is marginally more efficient and better fits how some other people work. That also allows you to keep your style more similar as you move between Perl and other languages. The whole wantarray and return a ref or a single element seems like a good idea, but my experience with it has not been very good.
So any choice you make can be defended.
In reply to Re: return ref is better ?
by tilly
in thread return ref is better ?
by odrevet
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |