On Friday 16 February 2001 11:20, Branden wrote:

> proposal. I don't think it works, because
> 
>     $a, $b, $c = @_;        # $c gets 10 for @_=(1..10)
> 
> mean a different thing that
> 
>     my $a, $b, $c = @_;     # $c gets 3 for @_=(1..10)

It does?

> 
> The last code should behave as
> 
>     my $a, $b, ($c = @_);

It doesn't?

> 
> ie. $a, $b and $c are lexicals, and @_ is assigned to $c in scalar 
context.
> I'm sure I posted this example a while ago.

It didn't make sense then, either.
Are you saying you wish to declare three lexical variables ($a and $b in 
void context, and $c to be the scalar value of @_?)

> `my' DWIMs.

But DWYM ne DWIM ne DWEM ne DWMPM ne DWSPM.
This solution is like trying to solve the world's financial problems by 
taking the richest guy's wealth and distributing it among everyone else.
It doesn't solve anything, it just redistributes the problem.

> I know this is bad for who already writes Perl code. 

Then why is it being discussed?

> But it would be very
> good for who learns Perl and doesn't understand exactly when he should and
> when he should not put parenthesis around `my's list of variables.

Then maybe the documentation should be improved.  Maybe makng a clearer 
delineation and how and why and when these work are in order.
Particularly once attributes come out in full force, which will also bind 
more tightly than , or =.  Simply offloading and compounding the problem 
isn't a viable solution.

-- 
Bryan C. Warnock
[EMAIL PROTECTED]

Reply via email to