Technically if you want to see if the hashref $hash has an element for key $var you want exists. Even so neither of those two examples should force a copy of %{$hash} (at least I don't believe so; however if there were multiple levels there such that you trigger autovivification (i.e. $hash->{'not there'}->{$var}) it would probably force a copy since you're implicitly changing $hash's contents). And if you really want read-only then Readonly will make it enforced not just by convention.
You might also want to consider using something like BerkelyDB or DBD::SQLite to access your data from disk rather than pulling it all into RAM.
Update: Or Cache::Memcache might be worth looking into as well.
Update: Duur, Readonly not ReadOnly. Thanks to superfrink for the catch.
The cake is a lie.
The cake is a lie.
The cake is a lie.
In reply to Re: fork(): where does copy happen?
by Fletch
in thread fork(): where does copy happen?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |