Help for this page

Select Code to Download


  1. or download this
    sub foo($x, $y) { say $x ~ $y };
    my $foo_ref = &foo;
    
  2. or download this
    my @bar = <a b c>;
    my $bar_ref = @bar;   # Assigns a reference. Ok.
    my $bar_ref2 := @bar  # Same as above? XXX
    my @bar_copy = @bar;  # Makes a copy of @bar. As expected.
    
  3. or download this
    my $qux = SomeClass.new;  # $qux is a reference to an object
    my $qux_ref = $qux;       # makes a copy of the reference (?)
    
  4. or download this
    my $xyz = 'hi';
    my $xyz_ref = $xyz;  # not a ref!