Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re^3: can I change hash keys or values directly (UPDATED)by Marshall (Canon) |
on Feb 04, 2021 at 21:27 UTC ( [id://11127898]=note: print w/replies, xml ) | Need Help?? |
Hi Rolf! I wrote: I will attempt to give a "short" answer to your "why not?" question. There may be some slight technical inaccuracies in pursuit of brevity. Also I will need some "C lingo" to explain what a Perl hash table actually "is", "under the covers". Underlining added for emphasis. I am actually surprised that there weren't more: "hey, you got detail X wrong" posts! My goal was to explain the basic idea and then show things like the scalar value of %hash which the user can access (added to my post using actual Perl code). Perl is very much a "live language" and updates are on-going. Its been maybe 5+ years since I looked seriously "at the guts".
Update: Perl is like an onion. To use an onion, first you have to take the thin skin off. Then you start slicing the onion. There are many layers. That is fundamental to what an onion is! So, how come some onion slices have a green thing in the middle? That is a level of detail that I didn't address and probably the OP doesn't need to know about in order to use an onion effectively. That is the best analogy that I can come up with at the moment. I hope that my post can be understood in time measured in minutes. To understand exactly everything about how Perl makes hashes, requires time measured in days, not minutes.
In Section
Seekers of Perl Wisdom
|
|