local $x; *x= \$y; # point the scalar slot to alias $y #... # $x goes back to pointing to its own slot when restoring.