in reply to Re^3: Perl Tk label references
in thread Perl Tk label references
++ Good job improving that part on your own...
Now look at what your original button's sub does: it assigned a new, empty hashref to the $ref_hash variable (as AM pointed out by printing multiple addresses when assigning the variable to multiple empty hashrefs: {}). Your updated one is an improvement, because it's accessing the original memory, rather than creating a new memory space. But you're deleting the keys and their values, rather than keeping the keys and just clearing the values.
update: strike out something that might not be accurate. But your second code was still an improvement, because you learned you needed to de-reference the hashref, rather than assigning a new empty hashref {}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Perl Tk label references
by pryrt (Abbot) on Nov 10, 2016 at 22:20 UTC | |
by thimes (Acolyte) on Nov 10, 2016 at 22:41 UTC |