Stop asking "is $var a reference to $object" - since nearly everything is a reference, it doesn't make too much sense.
Instead, you could ask questions like "if I change $var1, does $var2 change too?"
Those questions are easy to answer - you can just try them out.
You can also think of a variable being a name for a container, and that container holds a value. Assignment changes the value, binding the container.
Does that copy the object referred to by $qux
No. Assignment to a scalar never copies any object (just pointers, internally). Only if you assign to an array or hash variable (ie one beginning with @ or %), a shallow copy is made.
my $xyz = 'hi'; my $xyz_ref = $xyz; # not a ref!copies $xyz as expected. Correct?
No, just copies a reference to the string 'hi'. But since strings are immutable, you won't see any diference between two references to the same string, and two reference to copies of the same string.
In reply to Re^9: Reference in Perl 6
by moritz
in thread Reference in Perl 6
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |