Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Aliasing hash-element and scalar?

by dave_the_m (Monsignor)
on Sep 03, 2018 at 22:36 UTC ( #1221653=note: print w/replies, xml ) Need Help??


in reply to Aliasing hash-element and scalar?

From 5.22.0 onwards:
use feature 'refaliasing'; no warnings 'experimental'; my ($x, $y, %h); \$h{foo} = \$x; \$y = \$h{foo}; $x = 99; printf "%d %d %d\n", $x, $y, $h{foo}; # prints 99 99 99

Buts it's of course still an experimental feature.

Dave.

Replies are listed 'Best First'.
Re^2: Aliasing hash-element and scalar?
by LanX (Archbishop) on Sep 03, 2018 at 22:38 UTC
    cool thanks! :)

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2019-05-22 14:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (140 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!