update: I had no idea that wantarray was a function when I first wrote this response... I figured that was pseudo-code or something. :) Who knew (besides merlyn and everyone)?


This is sorta what we've been thinkin' about doing, where the wantarray would get decided depending on weather or not the function was called with _r or _ra, but I really really wanted a way where we didn't have to specify the wantarray... that it would just figure it out on it's own ...

oh well eh... *sigh*

we were also thinkin' like:

API->new_way; my @ret = $func->(@_); API->old_way; return @ret==1 ? $ret[0] : @ret;
Which is a solution we just came up with a little while ago ... I can't think of any reason why it wouldn't work since it would probably work with hashes, arrays, scalars, and ... what else is there? Can you think of an reason why this method is dumb?

In reply to Re: Re: uber-reference by jettero
in thread uber-reference by jettero

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.