Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Perl 6, difference between ':=' and '='

by chromatic (Archbishop)
on Aug 12, 2010 at 06:04 UTC ( [id://854589]=note: print w/replies, xml ) Need Help??


in reply to Perl 6, differrence between ':=' and '='

From Synopsis 03:

my $x = 'Just Another'; my $y := $x; $y = 'Perl Hacker'; say $x; say $y;

The assignment operator = assigns the value of its right operand to the container which is its left operand. The binding operator := associates the container of its right operand to the name which is its left operand.

Think of it a bit like Perl 5 references without the reference or dereference operators.

Replies are listed 'Best First'.
Re^2: Perl 6, difference between ':=' and '='
by DrWhy (Chaplain) on Aug 12, 2010 at 23:24 UTC
    I always understood it as closer to typeglob aliasing in Perl 5 rather than perl 5 style references. i.e.:
    # perl 6 $x := $y; # ~= perl 5 *x = \$y;

    --DrWhy

    "If God had meant for us to think for ourselves he would have given us brains. Oh, wait..."

      That's the best way to think of it, but I didn't want to explain typeglobs.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2025-12-09 14:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (90 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.