Perl 5.22 introduced the 'refaliasing' feature. The simplest solution to the example is:
use v5.22; use warnings; use feature 'refaliasing'; # Silence warnings if desired: no warnings 'experimental::refaliasing'; my ($x, $y); \$x = \$y; # alias here $x = 5; say $y; # prints 5
In reply to Re: How to force one variable to be an alias to another?
by vrk
in thread How to force one variable to be an alias to another?
by jdporter
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |