Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Dynamic Hash value

by rovf (Priest)
on Apr 21, 2010 at 07:49 UTC ( #835982=note: print w/replies, xml ) Need Help??


in reply to Dynamic Hash value

To really achieve what you want, you would need to give up in syntax a bit. For example, you could store a reference to the variable (instead of its value) into the hash, or a sub (in this case, a closure) which, when called, returns the actual value. You could make the accessing of the values a bit more fancy by using tie on your hash; but your requirement sounds so odd that we have maybe a XY Problem here - so maybe it would help if you would first explain why you want to do this. Then it would be easier to find a nice solution.

-- 
Ronald Fischer <ynnor@mm.st>

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2023-09-30 22:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?