Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: Unifying namespaces of @name and $name to simplify dereferencing? (experimental::refaliasing)(updated examples)

by LanX (Archbishop)
on Mar 26, 2016 at 12:21 UTC ( #1158825=note: print w/replies, xml ) Need Help??

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
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (14)
As of 2019-12-06 16:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (156 votes). Check out past polls.

    Notices?