return @out == 1 && ! wantarray ? $out[0] : @out;
So if @out has a single element, return '1'. If it contains zero or 2, or more elements, then if "wantarray", return @out, otherwise return the first element.
I can't imagine using that once, let alone thousands of times. ;)
Update: Woops, "&&" is higher on the precedence table than "?:" in any language I know of. My mistake.
Dave
In reply to Re^3: wantarray alternative
by davido
in thread wantarray alternative
by tqisjim
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |