=head1 TITLE Sane resolution to large function returns =head1 VERSION Maintainer: Jerrad Pierce Date: 17 Aug 2000 Mailing List: perl6-internals@perl.org Number: 127 Version: 1 Status: Developing =head1 ABSTRACT Perl has traditionally returned from various functions long (>3) lists of values. This can be somewhat frustrating, especially if you require one of the many datum returned. RFC 37 would have us break backward compatability to solve this "problem". =head1 DESCRIPTION Functions like stat() and get*() return long lists of values. The implementation is assumedly easy: just push some values out of C structs into the Perl return stack. This gives the end user a large list to deal with, which can be unwieldy, especially when a single datum is desired. The typical solution is to do something along the lines of C<(stat($file))[8]>. Not elegant, but it works. =head1 IMPLEMENTATION There has been a proposed new core function C. this seems to be generally regarded as a good thing. Fine. If it is implemented we should use it. Offending functions (See RFC 37) should use C internally to determine what to return i.e; a list or a hash. As for single datum access, I C[index]> or C{key}> should be considered. This however, is not the core of this proposal. Merely a possibility. Just as extending the inelegant metaphor above to C<{function()}->{key}> would become a possibility. =head1 REFERENCES RFC 21: Replace C with a generic C function RFC 37: Positional Return Lists Considered Harmful