in reply to Internals question - "exists" for hash keys versus grep'ing array
$cache{$_}++;That is poor form especially for your application. You aren't counting how often the element is present - you just care about whether the key exists. $cache{$_} = undef is better because the value isn't actually created and doesn't have to go through the whole postinc process. So its lighter weight on memory and on performance.
|
|---|