Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: How to force one variable to be an alias to another?

by vrk (Chaplain)
on Mar 09, 2017 at 11:05 UTC ( #1184019=note: print w/replies, xml ) Need Help??


in reply to How to force one variable to be an alias to another?

Perl 5.22 introduced the refalias feature. The simplest solution to the example is

use v5.22; use warnings; use feature 'refalias'; # Silence warnings if desired: no warnings 'experimental::refaliasing'; my ($x, $y); \$x = \$y; # alias here $x = 5; say $y; # prints 5

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2023-06-08 01:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you go to conferences?






    Results (29 votes). Check out past polls.

    Notices?