in reply to Caching for SQLite

define "solution"

Replies are listed 'Best First'.
Re^2: Caching for SQLite
by bash (Scribe) on Sep 05, 2007 at 06:58 UTC
    something like this
    sub get_foo_object { my $foo_id = int(shift); my $obj = $Cache->get("$foo_id"); return $obj if $obj; $obj = $db->selectrow_hashref("SELECT .... FROM foo f, bar b ". "WHERE ... AND f.fooid=$foo_id"); $Cache->set("$foo_id", $obj); return $obj; }