Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Dynamic Hash value

by arc_of_descent (Hermit)
on Apr 21, 2010 at 07:48 UTC ( #835981=note: print w/replies, xml ) Need Help??


in reply to Dynamic Hash value

You can create scalar references to $ini and $last, and use these references in your %results hash. Then when you change the values of $ini and $last, the hash will refer to the changed values. Read up on references here - perlref
my $ini = 5; my $ini_ref = \$ini; print $$ini_ref; # outputs 5 $ini = 6; print $$ini_ref; outputs 6

Replies are listed 'Best First'.
Re^2: Dynamic Hash value
by LanX (Chancellor) on Apr 21, 2010 at 07:57 UTC
    no in this case it's not that simple because the scalars are not only referenced but also part of a calculation.

    Cheers Rolf

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://835981]
help
Chatterbox?
[Corion]: Lady_Aleena: Hopefully someone would step up to the plate!
[Lady_Aleena]: Corion, I could give the password to the gods to hold onto just in case.
[Discipulus]: Justin Case god can always get your pwd LA ;=) they all see, they all ear, they all know ;=)

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2017-04-26 08:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (471 votes). Check out past polls.