laziness, impatience, and hubris | |
PerlMonks |
Re: Comprehending Binary :=by raptor (Sexton) |
on Oct 06, 2001 at 19:56 UTC ( [id://117211]=note: print w/replies, xml ) | Need Help?? |
I had the same question on perl-language list, and here is theDamian answer : > Is the following correct for := : > > left side is like function in the respect that the right side is treated > differently depending on the left-side-types i.e. left side is like > prototype!! for the right side. Yep. > (@a ,@b) := (@b,@a) > is the same as : > (\@a, \@b) = (\@b, \@a);#if we had ref-allowed on the left in perl5 of > cource :") Yep. > ($x,@y) := (@b, @a) > is the same as : > ($x, \@y) = ($b[0],\@a); Nope. The $x lvalue confers scalar context on the first rvalue, so it's the same as: ($x,\@y) := (\@b, \@a) > Which is most close explanation : BIND or ALIAS It's a bind *and* an alias! ;-)
In Section
Seekers of Perl Wisdom
|
|