>   > Here is my suggestion: What if other functions were able to backtrace
>   > context and determine how many arguments to return just like split can?

>I have an RFC on that:

>       RFC 21: Replace C<wantarray> with a generic C<want> function

>        C<want> takes a list of strings that describe aspects of the
>        context in which the current subroutine has been called. It
>        returns a list indicating whether or not the current
>        subroutine's call context matches all the aspects specified in
>        the list ... at least one integer element is returned.

>        That integer (the "expectation count") indicates the number of
>        return values expected by the context. 

Ever consider then having

    ($a, $b, $c) = <FH>;
or
    @a[4,1,5] = <FH>;

only read three lines?  I mean, how many if any builtins would it
make sense to make aware of this, and do something "different"?
Seems a bit rare and unimportant -- until one observes how this
would also solve the problem of people being confused by this
gobbling up their handle:

    my($line) = <FH>;

--tom

Reply via email to