> > 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
- Re: RFC 175 (v1) Add C<list> keyword to forc... Nathan Wiger
- Re: RFC 175 (v1) Add C<list> keyword to ... Tom Christiansen
- Change "($one, $two)=" behavior ... Nathan Wiger
- Re: Change "($one, $two)=" b... Tom Christiansen
- Re: Change "($one, $two)=" b... Nathan Wiger
- Re: Change "($one, $two)=" b... Tom Christiansen
- Re: Change "($one, $two)=" b... Nathan Wiger
- Re: Change "($one, $two)=" b... Tom Hughes
- Re: Change "($one, $two)=" b... Jeremy Howard
- Re: Change "($one, $two)=" b... Damian Conway
- Re: Change "($one, $two)=" b... Tom Christiansen
- Re: Change "($one, $two)=" b... Nathan Wiger
- Re: Change "($one, $two)=" b... Peter Scott
- Re: Change "($one, $two)=" b... Jeremy Howard
- Re: Change "($one, $two)=" b... Nathan Wiger
- Re: RFC 175 (v1) Add C<list> keyword to forc... Randal L. Schwartz
- Re: RFC 175 (v1) Add C<list> keyword to force lis... Bart Lateur
- Re: RFC 175 (v1) Add C<list> keyword to forc... Tom Christiansen
- Re: RFC 175 (v1) Add C<list> keyword to forc... Tom Christiansen
- Re: RFC 175 (v1) Add C<list> keyword to ... Bart Lateur
- Re: RFC 175 (v1) Add C<list> keyword... Tom Christiansen