go ahead... be a heretic | |
PerlMonks |
Re^2: "exists $hash{key}" is slower than "$hash{key}"by swl (Parson) |
on Jan 06, 2020 at 00:57 UTC ( [id://11111017]=note: print w/replies, xml ) | Need Help?? |
If this is the case then it seems counter intuitive at first glance, and maybe is something that could be modified. One advantage of using exists $hash{$key} is that the hash values can then all be assigned undef, potentially saving memory. (Although one could also create a scalar ref and re-use it, e.g. my $flag = \1 - this is what is used in Hash::Ordered as a tombstone value.
In Section
Meditations
|
|