In-memory cache for object references
Brought to you by:
lachoy
Here's an example (from David Hugh-Jones):
my $test = My::Obj->fetch(1);
my $test2 = My::Obj->fetch(1);
$test2->{field} = 11;
# somewhere else ...
$test->{field} = 22;
$test->save;
# now we are out of sync
print $test->{field};
print $test2->{field};
Implement in-memory caching so that $test2 and $test
are actually the same object/reference.