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.