develooper Front page | perl.fwp | Postings from February 2005

Re: "Secret" operators

Thread Previous | Thread Next
From:
Quantum Mechanic
Date:
February 1, 2005 12:12
Subject:
Re: "Secret" operators
Message ID:
20050201201251.57765.qmail@web14025.mail.yahoo.com

--- Jos� Castro <jac@natura.di.uminho.pt> wrote:

> * Quantum Mechanic (quantum_mechanic_1964@yahoo.com)
> wrote:
> > $foo = ($bar) = (9,8,7);
> > 
> >     RHS list
> >     ($bar) array
> >     $bar <- 7 (rest discarded)
> 
> No, no, no.
> 
>       $bar <- 9
> 

Yes, that was a typo -- thanks.

> It's the same as
> 
>   $foo = ($bar, undef, undef) = (9, 8, 7);
> 
> Now the funny thing is that the result from
> 
>   $foo = ($bar, undef, undef, undef) = (9, 8, 7);
> 
> is still the same :-)

Ah, but that supports my theory. It's not the LHS of
the ($bar,...)= assignment that generates the data for
$foo -- it's the RHS. The LHS of the ($bar,...)=
assignment determines the *context* of the $foo=
assignment.

Q.E.D. The quantity of elements on the LHS don't
matter, but the quality of the LHS does.

-QM

=====
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Quantum Mechanics: The dreams stuff is made of


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - now with 250MB free storage. Learn more.
http://info.mail.yahoo.com/mail_250

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About