Help for this page

Select Code to Download


  1. or download this
    use 5.22.0;
    use feature qw/say refaliasing/;
    ...
    say "noref: $a[0], ref: $a->[0], list: @a";    
    $a = [42];
    say "noref: $a[0], ref: $a->[0], list: @a";
    
  2. or download this
    noref: 666, ref: 666, list: 666
    noref: 666, ref: 42, list: 666
    
  3. or download this
    use 5.22.0;
    use feature qw/say refaliasing/;
    ...
        (\my @sub, my $ref) = @_;
        say "noref: $sub[0], ref: $ref->[0], list: @sub";
    }
    
  4. or download this
    noref: 666, ref: 666, list: 666 42