Beefy Boxes and Bandwidth Generously Provided by pair Networks
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??


in reply to Comprehending Binary :=

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! ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://117211]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-25 02:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found