[EMAIL PROTECTED] wrote:
> Does that mean there's going to be a @__ as well, for uses in list context?
> If so, what happens with:
>
> sub some_sub {
> @__ = qw /foo bar baz/;
> }
>
> my $fnord = some_sub;
>
> If there isn't going to be a @__ of some sorts, how is the case of the sub
> being called in list context going to be handled?
>
> Abigail
If $__ is a reference to our lvalue, if any, instead of an alias, since
references are all scalar, we can take C<ref($__)> to get a finely
grained C<want> function.
And when the sub is called in list context, @$__ will be the list.
This allows intrusive functionality to fiddle with lvalue parts:
sub DirectBubbleSort(){
my ($i,$t) = (-1,0);
while (++$i <= $#$__){
$$__[$i] > $$__[1+$i] and $t++ and @$__[$i,1+$i] =
@$__[1+$i,$i];
};
$t and @$__ = DirectBubbleSort;
}
@SomeList = DirectBubbleSort; # instead of DirectBubbleSort(\@SomeList)
--
David Nicol 816.235.1187 [EMAIL PROTECTED]
www.tmcm.com, dammit