P is for Practical | |
PerlMonks |
Re: Confused on Scalar/Hashby LanX (Saint) |
on Apr 02, 2018 at 15:41 UTC ( [id://1212175]=note: print w/replies, xml ) | Need Help?? |
I personally understand %hash as the "list form" of a hash. You assign lists and you get lists of elements. i.e. %hash2 = %hash will copy the lists of key-value pairs into a new hash. $hash_ref = \%hash is a pointer to the container. $hash_ref2 = $hash_ref will share the same hash. changing $hash_ref2->{a}++ will also effect $hash_ref Many other languages only know the reference form. Like in JS hash={...} is a hash_ref. HTH!
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|