more useful options | |
PerlMonks |
Re: Potential hash key ids limitationsby LanX (Saint) |
on Jan 19, 2023 at 04:01 UTC ( [id://11149680]=note: print w/replies, xml ) | Need Help?? |
Short answer: any kind of string and string length can be a key. ° > (length-wise I mean). Of course you can hit the memory limits and trigger the OS to do page swapping to the hard disc, which will slow down things considerably. But that's always the case for big data and not particular to the key's length. So yes, key lengths in the order of GBs will expose limitations, but so will simple strings too.
Cheers Rolf °) IIRC: the way keys are internally stored is actually a bit complicated in order to make it memory efficient. If you reuse a very long key in multiple hashes, you'll notice that the corresponding string is only stored once globally and all equivalent hash-keys will point to that string.
In Section
Seekers of Perl Wisdom
|
|