in reply to Re: Unifying namespaces of @name and $name to simplify dereferencing?
in thread Unifying namespaces of @name and $name to simplify dereferencing?
... not sure if it solves the all issues yet...
But you know these new possibilities deserve a proper thread ...
-->use 5.22.0; use feature qw/say refaliasing/; no warnings "experimental::refaliasing"; \my @a = my $a = [666]; say "noref: $a[0], ref: $a->[0], list: @a"; $a = [42]; say "noref: $a[0], ref: $a->[0], list: @a";
noref: 666, ref: 666, list: 666 noref: 666, ref: 42, list: 666
at least passing arrays to arrays is possible now
-->use 5.22.0; use feature qw/say refaliasing/; no warnings "experimental::refaliasing"; my @a = (666,42); test (\@a,\@a); sub test { (\my @sub, my $ref) = @_; say "noref: $sub[0], ref: $ref->[0], list: @sub"; }
noref: 666, ref: 666, list: 666 42
well the syntax when passing more than one argument is not very elegant, see duplicated my ... but at least it's consistent.
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!
|
|---|