Bart Lateur writes:
: Because you might have a wantarray situation that expects no values?
: 
:       () =3D whateveryouwant();
: 
: You can always expect one more than is on the LHS.
: 
: How is this currently handled with split()?

It fakes up a third argument that is one more than the length of the
list.

In Perl 6, we'll have a unary * that (in an lvalue or formal parameter)
marks the following item as a "slurper".  So in a list assignment,
these work differently:

    (@a, @b, @c) = ...;         # provides 3 scalar contexts
    (@a, @b, *@c) = ...;        # provides 2 scalar and 1 list context

So by analogy, we could conceivably have:

    ($a, $b, $c) = split;       # splits in 3 spots
    ($a, $b, *$rest) = split;   # splits in 2 spots

But what that would mean in a formal parameter list, I have no idea.
So * on a scalar might not fly in general.

A unary * in rvalue context defeats signature checking for the rest
of the arguments in the list.  So Perl 5's:

    &foo(@list)

would likely be translated to Perl 6's:

    foo(*@list)

Larry

Reply via email to